__try_to_del_timer_sync(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __try_to_del_timer_sync (9) β€” Kernel API Manual ✨

okay bestie, welcome to the __try_to_del_timer_sync (9) page of the Kernel API Manual πŸŽ€ this one is internal, so it's giving backstage-pass energy β€” not for the general public, iykyk 🫢


✨ NAME ✨

__try_to_del_timer_sync β€” Internal function: Try to deactivate a timer πŸ•°οΈ


🌸 SYNOPSIS 🌸

int __try_to_del_timer_sync (struct timer_list *timer , bool shutdown );

like literally that's the whole vibe. two args, one int out πŸ’–


πŸ¦‹ ARGUMENTS πŸ¦‹

  • timer β€” the timer you want to deactivate πŸ’… this is your main character
  • shutdown β€” if it's true, this is telling the kernel that the timer is about to be shut down permanently 😭 forever-forever, no take-backs

πŸ’€ DESCRIPTION πŸ’€

So here's the tea β˜• if shutdown is true, then timer->function gets set to NULL under the timer base lock, which prevents any further rearming of the timer. Slay πŸ”₯ and any attempt to rearm the timer after this function returns will be silently ignored β€” like, it just won't happen, no error, no drama, nothing 🌈

But ngl, there's a catch πŸ™ˆ this function cannot guarantee that the timer can't be rearmed right after dropping the base lock when shutdown is false. If you need that guaranteed, the calling code has to prevent it itself β€” not this function's problem, bestie πŸ’…

fr fr, respect the lock boundaries or the timer will humble you 🫢

πŸ‘‘ RETURN πŸ‘‘

  • 0 β€” the timer was not pending πŸŽ€
  • 1 β€” the timer was pending and got deactivated ✨ ate and left no crumbs
  • -1 β€” the timer callback function is running on a different CPU πŸ˜­πŸ’€ so like, it's busy elsewhere

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./kernel/time/timer.c plus all these iconic siblings, go say hi πŸ‘‹


and that's the whole page, bestie πŸ’œ this one lives in ./kernel/time and the version stamp is October 2026 β€” so like, mark your calendar, mwah πŸŽ€βœ¨πŸ‘‘

πŸ“¦ where this page comes from