pub struct AtomicScheduler { /* private fields */ }
Expand description
Thread-safe atomic scheduler
Implementations§
Source§impl AtomicScheduler
impl AtomicScheduler
pub const fn new() -> Self
pub fn spawn_thread( &self, stack: &'static mut [u8], entry_point: fn(), priority: u8, ) -> ThreadResult<ThreadId>
pub fn schedule(&self) -> Option<ThreadId>
pub fn get_current_thread(&self) -> Option<ThreadId>
pub fn set_current_thread(&self, thread_id: Option<ThreadId>)
pub fn get_thread(&self, thread_id: ThreadId) -> Option<&Thread>
Sourcepub unsafe fn get_thread_mut(&self, thread_id: ThreadId) -> Option<&mut Thread>
pub unsafe fn get_thread_mut(&self, thread_id: ThreadId) -> Option<&mut Thread>
§Safety
Returns mutable reference to thread. Caller must ensure thread safety.
pub fn exit_current_thread(&self)
pub fn switch_context( &self, from_id: ThreadId, to_id: ThreadId, ) -> ThreadResult<()>
Trait Implementations§
Source§impl Default for AtomicScheduler
impl Default for AtomicScheduler
impl Sync for AtomicScheduler
Auto Trait Implementations§
impl !Freeze for AtomicScheduler
impl !RefUnwindSafe for AtomicScheduler
impl !Send for AtomicScheduler
impl Unpin for AtomicScheduler
impl !UnwindSafe for AtomicScheduler
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