Thread

Struct Thread 

Source
pub struct Thread {
    state: State,
    uid: UId,
    rt_server: Option<RtServer>,
    waiter: Option<Waiter>,
    rr_links: Links<RRList, UId>,
    thread_links: Links<ThreadList, UId>,
}
Expand description

The struct representing a thread.

Fields§

§state: State

The current state of the thread.

§uid: UId

The unique identifier of the thread.

§rt_server: Option<RtServer>

If the thread is real-time, its contains a constant bandwidth server.

§waiter: Option<Waiter>§rr_links: Links<RRList, UId>§thread_links: Links<ThreadList, UId>

Implementations§

Source§

impl Thread

Source

pub fn new(uid: UId, stack: Stack, rtattrs: Option<RtAttrs>) -> Self

Create a new thread.

stack - The stack of the thread.

Returns a new thread.

Source

pub fn set_waiter(&mut self, waiter: Option<Waiter>)

Source

pub fn waiter(&self) -> Option<&Waiter>

Source

pub fn save_ctx(&mut self, ctx: *mut c_void) -> Result<(), Error>

Source

pub fn set_run_state(&mut self, state: RunState)

Source

pub fn rt_server(&self) -> Option<&RtServer>

Source

pub fn ctx(&self) -> *mut c_void

Source

pub fn uid(&self) -> UId

Source

pub fn task_id(&self) -> UId

Trait Implementations§

Source§

impl Clone for Thread

Source§

fn clone(&self) -> Thread

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Thread

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Linkable<RRList, UId> for Thread

Source§

impl Linkable<ThreadList, UId> for Thread

Source§

impl PartialEq for Thread

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Project<RtServer> for Thread

Source§

fn project(&self) -> Option<&RtServer>

Source§

fn project_mut(&mut self) -> Option<&mut RtServer>

Source§

impl Project<Waiter> for Thread

Source§

fn project(&self) -> Option<&Waiter>

Source§

fn project_mut(&mut self) -> Option<&mut Waiter>

Source§

impl Copy for Thread

Auto Trait Implementations§

§

impl Freeze for Thread

§

impl RefUnwindSafe for Thread

§

impl !Send for Thread

§

impl !Sync for Thread

§

impl Unpin for Thread

§

impl UnwindSafe for Thread

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.