rt_mutex_lock_killable(9)
π rt_mutex_lock_killable β like, the Kernel API Manual, but make it cute β¨
Okay bestie, so you've stumbled into the kernel's locking docs (iconic of you) and today's main character is rt_mutex_lock_killable. The name is a whole mouthful but honestly? The vibe is simple: you want the lock, and you're allowed to bail if a signal comes knocking. No cap.
πΈ NAME πΈ
rt_mutex_lock_killable β lock a rt_mutex, but killable. That's literally it, that's the whole personality. π
β¨ SYNOPSIS β¨
int rt_mutex_lock_killable (struct rt_mutex *lock );
Look at her. One function, one argument, one int coming back at you. Lowkey elegant, highkey underrated. π
π¦ ARGUMENTS π¦
lockβ thert_mutexto be locked. This is the mutex, the one you're trying to get your hands on. Give it the lock, get the lock. Slay. π₯
β RETURN β
So here's what she gives back to you, and it's giving "yes or interrupted":
0β on success. You got the lock bestie, go do your little critical section, you earned it. π-EINTRβ when interrupted by a signal. Not a failure era, just a "hey, something poked you, come back later" moment. π
Fr fr, don't just ignore that -EINTR β that's a real value with real meaning, iykyk.
π SEE ALSO π
The whole friend group, gathered in the Kernel file ./kernel/locking/rtmutex_api.c π«Ά:
rt_mutex_lock_nested(9)rt_mutex_lock(9)rt_mutex_lock_interruptible(9)rt_mutex_trylock(9)rt_mutex_unlock(9)__rt_mutex_futex_unlock(9)__rt_mutex_init(9)rt_mutex_init_proxy_locked(9)rt_mutex_proxy_unlock(9)__rt_mutex_start_proxy_lock(9)rt_mutex_start_proxy_lock(9)rt_mutex_wait_proxy_lock(9)rt_mutex_cleanup_proxy_lock(9)
Like, the entire rtmutex cinematic universe. Obsessed. π
And that's the page, bestie π§ β brought to you straight outta ./kernel/locking, dated October 2026, and signed off with love by rt_mutex_lock_killable(9). Go forth and lock responsibly, -EINTR and all β¨ππ¦
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms