[][src]Struct sunrise_libuser::thread_local_storage::TlsElf

pub struct TlsElf {
    static_region: ThreadLocalStaticRegion,
}

The Thread Local Storage manager for a thread

We allocate one for every thread we create, and store it in the thread's context. When it is dropped, all allocated memory is freed.

Fields

static_region: ThreadLocalStaticRegion

The array of static module blocks + TCB

Implementations

impl TlsElf[src]

pub fn allocate() -> Self[src]

Allocates and initializes the static region, including TCB.

Finds out the location of the initialization image from linker defined symbols.

pub unsafe fn enable_for_current_thread(&self)[src]

Calls syscalls::set_thread_area with the address of this TlsElf's ThreadControlBlock.

Safety

The TlsElf should not be enabled_for_current_thread by any other thread. Having a TLS shared by multiple threads is UB.

Panics

Panics if the syscall returned an error, as this is unrecoverable.

Trait Implementations

impl Debug for TlsElf[src]

Auto Trait Implementations

impl RefUnwindSafe for TlsElf

impl Send for TlsElf

impl Sync for TlsElf

impl Unpin for TlsElf

impl UnwindSafe for TlsElf

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SizedIPCBuffer for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.