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 __devm_mutex_init(struct device *dev, struct mutex *lock);
133 static inline int __devm_mutex_init(struct device *dev, struct mutex *lock) in __devm_mutex_init()
144 #define devm_mutex_init(dev, mutex) \ argument
146 typeof(mutex) mutex_ = (mutex); \
153 * See kernel/locking/mutex.c for detailed documentation of these APIs.
154 * Also see Documentation/locking/mutex-design.rst.
157 extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass);
158 extern void _mutex_lock_nest_lock(struct mutex *lock, struct lockdep_map *nest_lock);
160 extern int __must_check mutex_lock_interruptible_nested(struct mutex *lock,
162 extern int __must_check mutex_lock_killable_nested(struct mutex *lock,
164 extern void mutex_lock_io_nested(struct mutex *lock, unsigned int subclass);
178 extern void mutex_lock(struct mutex *lock);
179 extern int __must_check mutex_lock_interruptible(struct mutex *lock);
180 extern int __must_check mutex_lock_killable(struct mutex *lock);
181 extern void mutex_lock_io(struct mutex *lock);
194 * Returns 1 if the mutex has been acquired successfully, and 0 on contention.
196 extern int mutex_trylock(struct mutex *lock);
197 extern void mutex_unlock(struct mutex *lock);
199 extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock);
201 DEFINE_GUARD(mutex, struct mutex *, mutex_lock(_T), mutex_unlock(_T))
202 DEFINE_GUARD_COND(mutex, _try, mutex_trylock(_T))
203 DEFINE_GUARD_COND(mutex, _intr, mutex_lock_interruptible(_T) == 0)