Lines Matching full:mutex
42 extern void mutex_destroy(struct mutex *lock);
48 static inline void mutex_destroy(struct mutex *lock) {} in mutex_destroy()
53 * mutex_init - initialize the mutex
54 * @mutex: the mutex to be initialized
56 * Initialize the mutex to unlocked state.
58 * It is not allowed to initialize an already locked mutex.
60 #define mutex_init(mutex) \ argument
64 __mutex_init((mutex), #mutex, &__key); \
68 * mutex_init_with_key - initialize a mutex with a given lockdep key
69 * @mutex: the mutex to be initialized
70 * @key: the lockdep key to be associated with the mutex
72 * Initialize the mutex to the unlocked state.
74 * It is not allowed to initialize an already locked mutex.
76 #define mutex_init_with_key(mutex, key) __mutex_init((mutex), #mutex, (key)) argument
87 struct mutex mutexname = __MUTEX_INITIALIZER(mutexname)
89 extern void __mutex_init(struct mutex *lock, const char *name,
93 * mutex_is_locked - is the mutex locked
94 * @lock: the mutex to be queried
96 * Returns true if the mutex is locked, false if unlocked.
98 extern bool mutex_is_locked(struct mutex *lock);
112 struct mutex mutexname = __MUTEX_INITIALIZER(mutexname)
114 extern void __mutex_rt_init(struct mutex *lock, const char *name,
119 #define __mutex_init(mutex, name, key) \ argument
121 rt_mutex_base_init(&(mutex)->rtmutex); \
122 __mutex_rt_init((mutex), name, key); \
129 int __must_check __devm_mutex_init(struct device *dev, struct mutex *lock);
133 static inline int __must_check __devm_mutex_init(struct device *dev, struct mutex *lock) in __devm_mutex_init()
144 #define __mutex_init_ret(mutex) \ argument
146 typeof(mutex) mutex_ = (mutex); \
152 #define devm_mutex_init(dev, mutex) \ argument
153 __devm_mutex_init(dev, __mutex_init_ret(mutex))
156 * See kernel/locking/mutex.c for detailed documentation of these APIs.
157 * Also see Documentation/locking/mutex-design.rst.
160 extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass);
161 extern void _mutex_lock_nest_lock(struct mutex *lock, struct lockdep_map *nest_lock);
162 extern int __must_check mutex_lock_interruptible_nested(struct mutex *lock,
164 extern int __must_check _mutex_lock_killable(struct mutex *lock,
166 extern void mutex_lock_io_nested(struct mutex *lock, unsigned int subclass);
189 extern void mutex_lock(struct mutex *lock);
190 extern int __must_check mutex_lock_interruptible(struct mutex *lock);
191 extern int __must_check mutex_lock_killable(struct mutex *lock);
192 extern void mutex_lock_io(struct mutex *lock);
206 * Returns 1 if the mutex has been acquired successfully, and 0 on contention.
210 extern int _mutex_trylock_nest_lock(struct mutex *lock, struct lockdep_map *nest_lock);
220 extern int mutex_trylock(struct mutex *lock);
224 extern void mutex_unlock(struct mutex *lock);
226 extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock);
228 DEFINE_GUARD(mutex, struct mutex *, mutex_lock(_T), mutex_unlock(_T))
229 DEFINE_GUARD_COND(mutex, _try, mutex_trylock(_T))
230 DEFINE_GUARD_COND(mutex, _intr, mutex_lock_interruptible(_T), _RET == 0)
232 extern unsigned long mutex_get_owner(struct mutex *lock);