Lines Matching full:arc
36 //! use kernel::sync::Arc;
51 //! fn new(value: i32) -> Result<Arc<Self>> {
52 //! Arc::pin_init(pin_init!(MyStruct {
60 //! type Pointer = Arc<MyStruct>;
62 //! fn run(this: Arc<MyStruct>) {
69 //! fn print_later(val: Arc<MyStruct>) {
78 //! use kernel::sync::Arc;
97 //! fn new(value_1: i32, value_2: i32) -> Result<Arc<Self>> {
98 //! Arc::pin_init(pin_init!(MyStruct {
108 //! type Pointer = Arc<MyStruct>;
110 //! fn run(this: Arc<MyStruct>) {
116 //! type Pointer = Arc<MyStruct>;
118 //! fn run(this: Arc<MyStruct>) {
123 //! fn print_1_later(val: Arc<MyStruct>) {
124 //! let _ = workqueue::system().enqueue::<Arc<MyStruct>, 1>(val);
127 //! fn print_2_later(val: Arc<MyStruct>) {
128 //! let _ = workqueue::system().enqueue::<Arc<MyStruct>, 2>(val);
137 use crate::{prelude::*, sync::Arc, sync::LockClassKey, types::Opaque};
303 /// This trait is implemented by `Pin<KBox<T>>` and [`Arc<T>`], and is mainly intended to be
334 /// The pointer type that this struct is wrapped in. This will typically be `Arc<Self>` or
484 /// use kernel::sync::Arc;
533 // implementation of `WorkItemPointer` for `Arc<T>`.
534 unsafe impl<T, const ID: u64> WorkItemPointer<ID> for Arc<T> implementation
542 // SAFETY: This computes the pointer that `__enqueue` got from `Arc::into_raw`. in run()
544 // SAFETY: This pointer comes from `Arc::into_raw` and we've been given back ownership. in run()
545 let arc = unsafe { Arc::from_raw(ptr) }; in run() localVariable
547 T::run(arc) in run()
552 // the closure because we get it from an `Arc`, which means that the ref count will be at least 1,
553 // and we don't drop the `Arc` ourselves. If `queue_work_on` returns true, it is further guaranteed
558 unsafe impl<T, const ID: u64> RawWorkItem<ID> for Arc<T> implementation
570 let ptr = Arc::into_raw(self).cast_mut(); in __enqueue()
572 // SAFETY: Pointers into an `Arc` point at a valid value. in __enqueue()
581 Err(unsafe { Arc::from_raw(ptr) }) in __enqueue()
595 // SAFETY: This computes the pointer that `__enqueue` got from `Arc::into_raw`. in run()
597 // SAFETY: This pointer comes from `Arc::into_raw` and we've been given back ownership. in run()