Module std::rt::local_ptr

The runtime needs to be able to put a pointer into thread-local storage. The runtime needs to be able to put a pointer into thread-local storage. Access to a single thread-local pointer.

The runtime will use this for storing ~Task.

XXX: Add runtime checks for usage of inconsistent pointer types. and for overwriting an existing pointer.

Functions

borrow

Borrow the thread-local value from thread-local storage. While the value is borrowed it is not available in TLS.

exists

Check whether there is a thread-local pointer installed.

init_tls_key

Initialize the TLS key. Other ops will fail if this isn't executed first.

maybe_tls_key
put

Give a pointer to thread-local storage.

take

Take ownership of a pointer from thread-local storage.

try_unsafe_borrow
unsafe_borrow

Borrow a mutable reference to the thread-local value

unsafe_take

Take ownership of a pointer from thread-local storage.