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 { in cancel()
30 let self_ptr = Arc::as_ptr(&self.inner); in cancel()
51 impl<T> HrTimerPointer for Arc<T> implementation
64 ) -> ArcHrTimerHandle<T> { in start()
66 // - We keep `self` alive by wrapping it in a handle below. in start()
67 // - Since we generate the pointer passed to `start` from a valid in start()
69 unsafe { T::start(Arc::as_ptr(&self), expires) }; in start()
74 impl<T> RawHrTimerCallback for Arc<T> implementation
82 unsafe extern "C" fn run(ptr: *mut bindings::hrtimer) -> bindings::hrtimer_restart { in run()
87 // queuing the timer, so it is a `HrTimer<T>` embedded in a `T`. in run()
91 // - `data_ptr` is derived form the pointer to the `T` that was used to in run()
92 // queue the timer. in run()
93 // - As per the safety requirements of the trait `HrTimerHandle`, the in run()
94 // `ArcHrTimerHandle` associated with this timer is guaranteed to in run()
98 // - We own one refcount in the `ArcTimerHandle` associated with this in run()
99 // timer, so it is not possible to get a `UniqueArc` to this in run()
100 // allocation from other `Arc` clones. in run()
104 // - By C API contract `timer_ptr` is the pointer that we passed when queuing the timer, so in run()
106 // - We are within `RawHrTimerCallback::run` in run()