Lines Matching +full:signal +full:- +full:guard
1 // SPDX-License-Identifier: GPL-2.0
8 use super::{lock::Backend, lock::Guard, LockClassKey};
22 /// Creates a [`CondVar`] initialiser with the given name and a newly-created lock class.
36 /// [`CondVar::notify_all`]) or because the thread received a signal. It may also wake up
60 /// let mut guard = e.value.lock();
61 /// while *guard != v {
62 /// e.value_changed.wait(&mut guard);
73 /// fn new_example() -> Result<Pin<Box<Example>>> {
75 /// value <- new_mutex!(0),
76 /// value_changed <- new_condvar!(),
88 /// self-referential, so it cannot be safely moved once it is initialised.
105 pub fn new(name: &'static CStr, key: &'static LockClassKey) -> impl PinInit<Self> { in new()
110 wait_queue_head <- Opaque::ffi_init(|slot| unsafe { in new()
119 guard: &mut Guard<'_, T, B>, in wait_internal()
121 ) -> c_long { in wait_internal()
133 let ret = guard.do_unlocked(|| unsafe { bindings::schedule_timeout(timeout_in_jiffies) }); in wait_internal()
143 /// Atomically releases the given lock (whose ownership is proven by the guard) and puts the
147 pub fn wait<T: ?Sized, B: Backend>(&self, guard: &mut Guard<'_, T, B>) { in wait()
148 self.wait_internal(TASK_UNINTERRUPTIBLE, guard, MAX_SCHEDULE_TIMEOUT); in wait()
156 /// Returns whether there is a signal pending.
157 …#[must_use = "wait_interruptible returns if a signal is pending, so the caller must check the retu…
158 pub fn wait_interruptible<T: ?Sized, B: Backend>(&self, guard: &mut Guard<'_, T, B>) -> bool { in wait_interruptible()
159 self.wait_internal(TASK_INTERRUPTIBLE, guard, MAX_SCHEDULE_TIMEOUT); in wait_interruptible()
165 /// Atomically releases the given lock (whose ownership is proven by the guard) and puts the
167 /// [`CondVar::notify_all`], or when a timeout occurs, or when the thread receives a signal.
168 …#[must_use = "wait_interruptible_timeout returns if a signal is pending, so the caller must check …
171 guard: &mut Guard<'_, T, B>, in wait_interruptible_timeout()
173 ) -> CondVarTimeoutResult { in wait_interruptible_timeout()
175 let res = self.wait_internal(TASK_INTERRUPTIBLE, guard, jiffies); in wait_interruptible_timeout()
178 (jiffies, true) => CondVarTimeoutResult::Signal { jiffies }, in wait_interruptible_timeout()
233 /// A signal occurred.
234 Signal { enumerator