* [PATCH] locking/mutex: define conditional guard for for mutex_lock_killable()
@ 2025-12-19 15:25 Carlos López
0 siblings, 0 replies; only message in thread
From: Carlos López @ 2025-12-19 15:25 UTC (permalink / raw)
To: linux-kernel
Cc: Carlos López, Peter Zijlstra, Ingo Molnar, Will Deacon,
Boqun Feng, Waiman Long
Allow using guards with mutex_lock_killable(), just like we currently do
with mutex_lock_interruptable(), e.g.
scoped_guard(mutex_killable, &my_mutex) {
...
}
Signed-off-by: Carlos López <clopez@suse.de>
---
include/linux/mutex.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/mutex.h b/include/linux/mutex.h
index bf535f0118bb..931a139e6176 100644
--- a/include/linux/mutex.h
+++ b/include/linux/mutex.h
@@ -253,6 +253,7 @@ extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock);
DEFINE_GUARD(mutex, struct mutex *, mutex_lock(_T), mutex_unlock(_T))
DEFINE_GUARD_COND(mutex, _try, mutex_trylock(_T))
DEFINE_GUARD_COND(mutex, _intr, mutex_lock_interruptible(_T), _RET == 0)
+DEFINE_GUARD_COND(mutex, _killable, mutex_lock_killable(_T), _RET == 0)
extern unsigned long mutex_get_owner(struct mutex *lock);
--
2.51.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-12-19 15:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-19 15:25 [PATCH] locking/mutex: define conditional guard for for mutex_lock_killable() Carlos López
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®