Skip to main content Skip to main content
Pigweed's logo Pigweed
code_xml
  1. Home
  2. Reference
  3. Rust
  4. pw_kernel
  5. kernel
  6. SchedLockGuard

SchedLockGuard

Struct SchedLockGuard 

Source
pub struct SchedLockGuard<'lock, 'sched, K: Kernel, T> {
    guard: SpinLockGuard<'sched, K, SchedulerState<K>>,
    inner: &'lock mut T,
    pub(super) kernel: K,
}

Fields§

§guard: SpinLockGuard<'sched, K, SchedulerState<K>>§inner: &'lock mut T§kernel: K

Implementations§

Source§

impl<'lock, 'sched, K: Kernel, T> SchedLockGuard<'lock, 'sched, K, T>

Source

pub fn sched(&self) -> &SpinLockGuard<'sched, K, SchedulerState<K>>

Source

pub fn sched_mut(&mut self) -> &mut SpinLockGuard<'sched, K, SchedulerState<K>>

Source

pub fn block(self, current_thread_id: usize, current_thead_state: State) -> Self

Source

pub unsafe fn smuggle(&self) -> SmuggledSchedLock<K, T>

§Safety

The caller must guarantee that the underlying lock remains valid and un-moved for the live the smuggled lock.

Source§

impl<K: Kernel> SchedLockGuard<'_, '_, K, WaitQueue<K>>

Source

fn add_to_queue_and_reschedule( self, thread: ForeignBox<Thread<K>>, wait_type: WaitType, ) -> Self

Source

unsafe fn process_timeout( &mut self, waiting_thread: *mut Thread<K>, ) -> Option<Error>

Source

pub fn wait(self, wait_type: WaitType) -> (Self, Result<()>)

Source

pub fn wait_until( self, wait_type: WaitType, deadline: Instant<K::Clock>, ) -> (Self, Result<()>)

Trait Implementations§

Source§

impl<K: Kernel, T> Deref for SchedLockGuard<'_, '_, K, T>

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &T

Dereferences the value.
Source§

impl<K: Kernel, T> DerefMut for SchedLockGuard<'_, '_, K, T>

Source§

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

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<'lock, 'sched, K, T> !RefUnwindSafe for SchedLockGuard<'lock, 'sched, K, T>

§

impl<'lock, 'sched, K, T> !UnwindSafe for SchedLockGuard<'lock, 'sched, K, T>

§

impl<'lock, 'sched, K, T> Forget for SchedLockGuard<'lock, 'sched, K, T>

§

impl<'lock, 'sched, K, T> Freeze for SchedLockGuard<'lock, 'sched, K, T>
where SpinLockGuard<'sched, K, SchedulerState<K>>: Freeze, &'lock mut T: Freeze, K: Freeze,

§

impl<'lock, 'sched, K, T> Move for SchedLockGuard<'lock, 'sched, K, T>

§

impl<'lock, 'sched, K, T> Send for SchedLockGuard<'lock, 'sched, K, T>
where SpinLockGuard<'sched, K, SchedulerState<K>>: Send, &'lock mut T: Send, K: Send,

§

impl<'lock, 'sched, K, T> Sync for SchedLockGuard<'lock, 'sched, K, T>
where SpinLockGuard<'sched, K, SchedulerState<K>>: Sync, &'lock mut T: Sync,

§

impl<'lock, 'sched, K, T> Unpin for SchedLockGuard<'lock, 'sched, K, T>
where SpinLockGuard<'sched, K, SchedulerState<K>>: Unpin, &'lock mut T: Unpin, K: Unpin,

§

impl<'lock, 'sched, K, T> UnsafeUnpin for SchedLockGuard<'lock, 'sched, K, T>
where SpinLockGuard<'sched, K, SchedulerState<K>>: UnsafeUnpin, &'lock mut T: UnsafeUnpin, K: UnsafeUnpin,

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
Source§

impl<T, U> CastInto<U> for T
where U: CastFrom<T>,

Source§

fn cast_into(self) -> U

§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
§

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

§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.