__timer_delete_sync(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __timer_delete_sync β€” the kernel API manual, but make it make sense ✨

okay so bestie, you've stumbled into the kernel's guts and found __timer_delete_sync β€” that's the internal function, the one behind the curtain, the main character of "please stop, timer, I need you gone and I need you to actually be gone." It deactivates a timer and waits for the handler to finish πŸŽ€

The manual name is __timer_delete_sync(9), by the way β€” section 9, kernel API manual, iykyk πŸ¦‹


🌸 SYNOPSIS 🌸

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

like, that's the whole vibe. two args, one int return, zero chill πŸ’…


✨ ARGUMENTS ✨

  • timer β€” the timer you're deactivating. that's the target, the one getting the ✨cancel treatment✨
  • shutdown β€” if it's true, then timer->function gets set to NULL under the timer base lock, which is what stops the timer from being rearmed, no cap 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea, and it's actually important tea β˜•

If shutdown is not set, the timer can be rearmed later. cute, flexible, whatever. BUT β€” and this is the part where you gotta pay attention β€” if the timer can be rearmed concurrently, like after the base lock has been dropped, then the return value is meaningless 😭 like fr fr meaningless. it's giving "don't @ me, i warned you."

If shutdown is set, then timer->function is set to NULL under the timer base lock, and that's what prevents the timer from being rearmed. any attempt to rearm a shutdown timer is silently ignored β€” like not even a little error, not even a peep, just πŸ’€ nothing. ghosted. periodt.

And if you wanna reuse that timer after shutdown? bestie, you have to initialize it again. no shortcuts, no "it'll probably be fine", it will not probably be fine 🌈

lowkey the whole point: shutdown = permanent, no take-backs, you gotta re-init to bring it back πŸ’œ

πŸ‘‘ RETURN πŸ‘‘

  • 0 β€” the timer was not pending πŸŽ€
  • 1 β€” the timer was pending and got deactivated, slay ✨

πŸ”₯ SEE ALSO πŸ”₯

oh we're doing the whole friend group, okay, gather round 🫢

The kernel file lives at ./kernel/time/timer.c, and it's hanging out with struct timer_base(9), plus literally everyone else:

like okay that's the entire timers extended universe, we love a comprehensive cast πŸ’–


and that's the whole page, bestie 🧚 this one comes from ./kernel/time, dated October 2026, and it's still filed under __timer_delete_sync(9) β€” so go forth, delete your timers synchronously, and remember: shutdown means shutdown πŸ’…βœ¨πŸ“

πŸ“¦ where this page comes from