Trait drone_cortexm::thr::SoftThread[][src]

pub unsafe trait SoftThread: Thread {
    pub fn pending() -> *const AtomicU32;
pub fn pending_priority() -> *const AtomicU8;
pub fn priority(&self) -> *const AtomicU8; pub unsafe fn set_pending(thr_idx: u16) { ... }
pub unsafe fn will_preempt(thr_idx: u16) -> bool { ... }
pub fn preempt() { ... } }

Software-managed thread.

Safety

SoftThread::pending must point to an array with pending_size number of elements.

Required methods

pub fn pending() -> *const AtomicU32[src]

Returns a raw pointer to the pending state storage.

pub fn pending_priority() -> *const AtomicU8[src]

Returns a raw pointer to the pending thread priority storage.

pub fn priority(&self) -> *const AtomicU8[src]

Returns a raw pointer to the thread priority storage.

Loading content...

Provided methods

pub unsafe fn set_pending(thr_idx: u16)[src]

Sets the thr_idx thread pending.

See the trait level documentation for details.

Safety

  • thr_idx must be less than Thread::COUNT.
  • This function doesn’t check for the thread token ownership.

pub unsafe fn will_preempt(thr_idx: u16) -> bool[src]

Sets the thr_idx thread pending and returns true if the thread priority is higher than the currently priority.

If this function returned true, a subsequent call to SoftThread::preempt is needed.

Safety

  • thr_idx must be less than Thread::COUNT.
  • This function doesn’t check for the thread token ownership.

pub fn preempt()[src]

Runs all pending threads with higher priorities than the current priority.

Loading content...

Implementors

Loading content...