Lines Matching +full:arc +full:- +full:timer
1 // SPDX-License-Identifier: GPL-2.0
11 use crate::sync::Arc;
14 /// A handle for an `Arc<HasHrTimer<T>>` returned by a call to
20 pub(crate) inner: Arc<T>,
23 // SAFETY: We implement drop below, and we cancel the timer in the drop
29 fn cancel(&mut self) -> bool {
30 let self_ptr = Arc::as_ptr(&self.inner);
51 impl<T> HrTimerPointer for Arc<T>
64 ) -> ArcHrTimerHandle<T> {
66 // - We keep `self` alive by wrapping it in a handle below.
67 // - Since we generate the pointer passed to `start` from a valid
69 unsafe { T::start(Arc::as_ptr(&self), expires) };
74 impl<T> RawHrTimerCallback for Arc<T>
82 unsafe extern "C" fn run(ptr: *mut bindings::hrtimer) -> bindings::hrtimer_restart {
87 // queuing the timer, so it is a `HrTimer<T>` embedded in a `T`.
91 // - `data_ptr` is derived form the pointer to the `T` that was used to
92 // queue the timer.
93 // - As per the safety requirements of the trait `HrTimerHandle`, the
94 // `ArcHrTimerHandle` associated with this timer is guaranteed to
98 // - We own one refcount in the `ArcTimerHandle` associated with this
99 // timer, so it is not possible to get a `UniqueArc` to this
100 // allocation from other `Arc` clones.
104 // - By C API contract `timer_ptr` is the pointer that we passed when queuing the timer, so
106 // - We are within `RawHrTimerCallback::run`