diff --git a/maitake/src/time/timer.rs b/maitake/src/time/timer.rs index 27fb91d5..1ba650d8 100644 --- a/maitake/src/time/timer.rs +++ b/maitake/src/time/timer.rs @@ -501,7 +501,7 @@ impl Timer { clock::dur_to_ticks(self.clock.tick_duration(), duration) } - fn advance_locked(&self, core: &mut MutexGuard<'_, wheel::Core>) -> Turn { + fn advance_locked(&self, core: &mut wheel::Core) -> Turn { // take any pending ticks. let pending_ticks = self.pending_ticks.swap(0, AcqRel) as Ticks; // we do two separate `advance` calls here instead of advancing once diff --git a/maitake/src/time/timer/sleep.rs b/maitake/src/time/timer/sleep.rs index 66f0ca42..92b291f1 100644 --- a/maitake/src/time/timer/sleep.rs +++ b/maitake/src/time/timer/sleep.rs @@ -113,8 +113,7 @@ impl Future for Sleep<'_> { let ptr = unsafe { ptr::NonNull::from(Pin::into_inner_unchecked(this.entry.as_mut())) }; // Acquire the wheel lock to insert the sleep. - let mut core: maitake_sync::spin::MutexGuard<'_, crate::time::timer::wheel::Core> = - this.timer.core(); + let mut core = this.timer.core(); // While we are holding the wheel lock, go ahead and advance the // timer, too. This way, the timer wheel gets advanced more diff --git a/maitake/src/time/timer/tests.rs b/maitake/src/time/timer/tests.rs index f200409f..4a252a13 100644 --- a/maitake/src/time/timer/tests.rs +++ b/maitake/src/time/timer/tests.rs @@ -58,6 +58,8 @@ impl ClockHandle { self.advance_ticks_inner(duration.as_millis() as u64) } + // This function isn't used in loom tests. + #[cfg_attr(loom, allow(dead_code))] pub fn advance_ticks(&self, ticks: Ticks) { info!(ticks, "advancing test clock by"); self.advance_ticks_inner(ticks) @@ -71,6 +73,8 @@ impl ClockHandle { ); } + // This function isn't used in loom tests. + #[cfg_attr(loom, allow(dead_code))] pub fn ticks(&self) -> Ticks { self.0.now.load(Ordering::SeqCst) }