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: StateThe current state of the thread.
uid: UIdThe 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
impl Thread
Sourcepub fn new(uid: UId, stack: Stack, rtattrs: Option<RtAttrs>) -> Self
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.
pub fn set_waiter(&mut self, waiter: Option<Waiter>)
pub fn waiter(&self) -> Option<&Waiter>
pub fn save_ctx(&mut self, ctx: *mut c_void) -> Result<(), Error>
pub fn set_run_state(&mut self, state: RunState)
pub fn rt_server(&self) -> Option<&RtServer>
pub fn ctx(&self) -> *mut c_void
pub fn uid(&self) -> UId
pub fn task_id(&self) -> UId
Trait Implementations§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more