Trait drone_core::thr::Thread [−][src]
Basic thread.
Safety
Thread::pool
must point to an array withThread::COUNT
number of elements.Thread::current
value must be zero-initialized.
Associated Types
Loading content...Associated Constants
Loading content...Required methods
fn pool() -> *const Self
[src]
Returns a raw pointer to the thread pool.
To obtain a safe reference to a thread object, use ThrToken::to_thr
method on the corresponding thread token instance.
fn current() -> *const AtomicU16
[src]
Returns a raw pointer to the current thread index storage.
fn fib_chain(&self) -> &Chain
[src]
Returns a reference to the fiber chain.
fn local_opaque(&self) -> &LocalOpaque<Self>
[src]
Returns a reference to the opaque thread-local storage.
Non-opaque thread-local storage can be obtained through
Thread::local
function.
Provided methods
fn local() -> &'static Self::Local
[src]
Returns a reference to the thread-local storage for the current thread.
The contents of this object can be customized with thr::pool!
macro. See the module-level documentation
for details.
Panics
This function will panic if called outside of this thread pool.
fn local_checked() -> Option<&'static Self::Local>
[src]
Returns a reference to the thread-local storage for the current thread.
If called outside of this thread pool, returns None
.
The contents of this object can be customized with thr::pool!
macro. See the module-level documentation
for details.
unsafe fn resume(&self)
[src]
unsafe fn call(thr_idx: u16, f: unsafe fn(_: &'static Self))
[src]
Runs the function f
inside the thread number thr_idx
.
Safety
- The function is not reentrant.
thr_idx
must be less thanThread::COUNT
.