Struct cloudabi::tcb
[−]
[src]
#[repr(C)]pub struct tcb { pub parent: *mut (), }
The Thread Control Block (TCB).
After a thread begins execution (at program startup or when
created through thread_create()
), the CPU's registers
controlling Thread-Local Storage (TLS) will already be
initialized. They will point to an area only containing the
TCB.
If the thread needs space for storing thread-specific variables, the thread may allocate a larger area and adjust the CPU's registers to point to that area instead. However, it does need to make sure that the TCB is copied over to the new TLS area.
The purpose of the TCB is that it allows light-weight emulators to store information related to individual threads. For example, it may be used to store a copy of the CPU registers prior emulation, so that TLS for the host system can be restored if needed.
Fields
parent: *mut ()
Pointer that may be freely assigned by the system. Its value cannot be interpreted by the application.