hrtimer_try_to_cancel(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay so bestie, welcome to the hrtimer_try_to_cancel(9) page from the Kernel API Manual β€” it’s short, it’s sweet, and it’s literally about trying to deactivate a timer πŸ’…βœ¨

πŸŽ€ NAME πŸŽ€

hrtimer_try_to_cancel β€” try to deactivate a timer. That’s the whole assignment, no cap 🫢

✨ SYNOPSIS ✨

Copy this exactly, bestie:

int hrtimer_try_to_cancel (struct hrtimer *timer );

🌸 ARGUMENTS 🌸

  • timer β€” the hrtimer to stop. That’s it, that’s the argument πŸŽ€

πŸ’– DESCRIPTION πŸ’–

Okay so the vibe check here is the return value, and it’s giving three possible outcomes:

  • 0 β€” when the timer was not active.
  • 1 β€” when the timer was active.
  • -1 β€” when the timer is currently executing the callback function and cannot be stopped.
lowkey important: -1 means it’s currently executing the callback function and cannot be stopped. No cap, don’t fight it 😭

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./kernel/time/hrtimer.c β€” and the whole friend group:


kisses and timer-safe hugs 🫢 β€” source/version: ./kernel/time Β· date: October 2026 Β· page: hrtimer_try_to_cancel(9) πŸ’œ

πŸ“¦ where this page comes from