pub struct PollCondVarBox { /* private fields */ }Expand description
A KBox<PollCondVar> that uses kfree_rcu.
Implementations§
Source§impl PollCondVarBox
impl PollCondVarBox
Sourcepub fn new(
name: &'static CStr,
key: Pin<&'static LockClassKey>,
) -> Result<Self, AllocError>
pub fn new( name: &'static CStr, key: Pin<&'static LockClassKey>, ) -> Result<Self, AllocError>
Constructs a new boxed PollCondVar.
Methods from Deref<Target = PollCondVar>§
Methods from Deref<Target = CondVar>§
Sourcepub fn project<'__pin>(self: Pin<&'__pin mut Self>) -> CondVarProjection<'__pin>
pub fn project<'__pin>(self: Pin<&'__pin mut Self>) -> CondVarProjection<'__pin>
Pin-projects all fields of Self.
These fields are structurally pinned:
wait_queue_head_pin
These fields are not structurally pinned:
Sourcepub fn wait<T: ?Sized, B: Backend>(&self, guard: &mut Guard<'_, T, B>)
pub fn wait<T: ?Sized, B: Backend>(&self, guard: &mut Guard<'_, T, B>)
Releases the lock and waits for a notification in uninterruptible mode.
Atomically releases the given lock (whose ownership is proven by the guard) and puts the
thread to sleep, reacquiring the lock on wake up. It wakes up when notified by
CondVar::notify_one or CondVar::notify_all. Note that it may also wake up
spuriously.
Sourcepub fn wait_interruptible<T: ?Sized, B: Backend>(
&self,
guard: &mut Guard<'_, T, B>,
) -> bool
pub fn wait_interruptible<T: ?Sized, B: Backend>( &self, guard: &mut Guard<'_, T, B>, ) -> bool
Releases the lock and waits for a notification in interruptible mode.
Similar to CondVar::wait, except that the wait is interruptible. That is, the thread may
wake up due to signals. It may also wake up spuriously.
Returns whether there is a signal pending.
Sourcepub fn wait_interruptible_freezable<T: ?Sized, B: Backend>(
&self,
guard: &mut Guard<'_, T, B>,
) -> bool
pub fn wait_interruptible_freezable<T: ?Sized, B: Backend>( &self, guard: &mut Guard<'_, T, B>, ) -> bool
Releases the lock and waits for a notification in interruptible and freezable mode.
The process is allowed to be frozen during this sleep. No lock should be held when calling this function, and there is a lockdep assertion for this. Freezing a task that holds a lock can trivially deadlock vs another task that needs that lock to complete before it too can hit freezable.
Sourcepub fn wait_interruptible_timeout<T: ?Sized, B: Backend>(
&self,
guard: &mut Guard<'_, T, B>,
jiffies: Jiffies,
) -> CondVarTimeoutResult
pub fn wait_interruptible_timeout<T: ?Sized, B: Backend>( &self, guard: &mut Guard<'_, T, B>, jiffies: Jiffies, ) -> CondVarTimeoutResult
Releases the lock and waits for a notification in interruptible mode.
Atomically releases the given lock (whose ownership is proven by the guard) and puts the
thread to sleep. It wakes up when notified by CondVar::notify_one or
CondVar::notify_all, or when a timeout occurs, or when the thread receives a signal.
Sourcepub fn notify_sync(&self)
pub fn notify_sync(&self)
Calls the kernel function to notify one thread synchronously.
This method behaves like notify_one, except that it hints to the scheduler that the
current thread is about to go to sleep, so it should schedule the target thread on the same
CPU.
Sourcepub fn notify_one(&self)
pub fn notify_one(&self)
Wakes a single waiter up, if any.
This is not ‘sticky’ in the sense that if no thread is waiting, the notification is lost completely (as opposed to automatically waking up the next waiter).
Sourcepub fn notify_all(&self)
pub fn notify_all(&self)
Wakes all waiters up, if any.
This is not ‘sticky’ in the sense that if no thread is waiting, the notification is lost completely (as opposed to automatically waking up the next waiter).
Trait Implementations§
Source§impl Deref for PollCondVarBox
impl Deref for PollCondVarBox
Source§type Target = PollCondVar
type Target = PollCondVar
Source§fn deref(&self) -> &PollCondVar
fn deref(&self) -> &PollCondVar
Source§impl Drop for PollCondVarBox
impl Drop for PollCondVarBox
Auto Trait Implementations§
impl !RefUnwindSafe for PollCondVarBox
impl !UnwindSafe for PollCondVarBox
impl Freeze for PollCondVarBox
impl Send for PollCondVarBox
impl Sync for PollCondVarBox
impl Unpin for PollCondVarBox
impl UnsafeUnpin for PollCondVarBox
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> KnownSize for T
impl<T> KnownSize for T
Source§impl<T> PinInit<T> for T
impl<T> PinInit<T> for T
Source§unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
slot. Read more