Trait drone_cortexm::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
pub 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.
pub fn current() -> *const AtomicU16
[src]
Returns a raw pointer to the current thread index storage.
pub fn fib_chain(&self) -> &Chain
[src]
Returns a reference to the fiber chain.
pub 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
pub 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.
pub 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.
pub unsafe fn resume(&self)
[src]
pub 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
.