Lines Matching full:completion
3 //! Completion support.
5 //! Reference: <https://docs.kernel.org/scheduler/completion.html>
7 //! C header: [`include/linux/completion.h`](srctree/include/linux/completion.h)
13 /// The [`Completion`] synchronization primitive signals when a certain task has been completed by
14 /// waking up other tasks that have been queued up to wait for the [`Completion`] to be completed.
19 /// use kernel::sync::{Arc, Completion};
27 /// done: Completion,
38 /// done <- Completion::new(),
49 /// pr_info!("Completion: task complete\n");
67 pub struct Completion { struct
69 inner: Opaque<bindings::completion>,
72 // SAFETY: `Completion` is safe to be send to any task. argument
73 unsafe impl Send for Completion {} implementation
75 // SAFETY: `Completion` is safe to be accessed concurrently.
76 unsafe impl Sync for Completion {} implementation
78 impl Completion { implementation
79 /// Create an initializer for a new [`Completion`].
82 inner <- Opaque::ffi_init(|slot: *mut bindings::completion| { in new()
83 // SAFETY: `slot` is a valid pointer to an uninitialized `struct completion`. in new()
89 fn as_raw(&self) -> *mut bindings::completion { in as_raw() argument
93 /// Signal all tasks waiting on this completion.
95 /// This method wakes up all tasks waiting on this completion; after this operation the
96 /// completion is permanently done, i.e. signals all current and future waiters.
98 // SAFETY: `self.as_raw()` is a pointer to a valid `struct completion`. in complete_all()
102 /// Wait for completion of a task.
104 /// This method waits for the completion of a task; it is not interruptible and there is no
107 /// See also [`Completion::complete_all`].
109 // SAFETY: `self.as_raw()` is a pointer to a valid `struct completion`. in wait_for_completion()