Trait drone_core::thr::SoftThread[][src]

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

Software-managed thread.

Safety

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

Required methods

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

Returns a raw pointer to the pending state storage.

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

Returns a raw pointer to the pending thread priority storage.

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

Returns a raw pointer to the thread priority storage.

Loading content...

Provided methods

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.

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.

fn preempt()[src]

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

Loading content...

Implementors

Loading content...