• Home
  • Raw
  • Download

Lines Matching full:mutex

28  * - only one task can hold the mutex at a time
29 * - only the owner can unlock the mutex
32 * - a mutex object must be initialized via the API
33 * - a mutex object must not be initialized via memset or copying
34 * - task may not exit with mutex held
41 * enabled. Furthermore, besides enforcing the above rules, the mutex
53 struct mutex { struct
72 struct mutex base; argument
80 * This is the control structure for tasks blocked on mutex,
97 extern void mutex_destroy(struct mutex *lock);
103 static inline void mutex_destroy(struct mutex *lock) {} in mutex_destroy()
108 * mutex_init - initialize the mutex
109 * @mutex: the mutex to be initialized
111 * Initialize the mutex to unlocked state.
113 * It is not allowed to initialize an already locked mutex.
115 #define mutex_init(mutex) \ argument
119 __mutex_init((mutex), #mutex, &__key); \
140 struct mutex mutexname = __MUTEX_INITIALIZER(mutexname)
142 extern void __mutex_init(struct mutex *lock, const char *name,
146 * mutex_is_locked - is the mutex locked
147 * @lock: the mutex to be queried
149 * Returns true if the mutex is locked, false if unlocked.
151 extern bool mutex_is_locked(struct mutex *lock);
154 * See kernel/locking/mutex.c for detailed documentation of these APIs.
155 * Also see Documentation/locking/mutex-design.rst.
158 extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass);
159 extern void _mutex_lock_nest_lock(struct mutex *lock, struct lockdep_map *nest_lock);
161 extern int __must_check mutex_lock_interruptible_nested(struct mutex *lock,
163 extern int __must_check mutex_lock_killable_nested(struct mutex *lock,
165 extern void mutex_lock_io_nested(struct mutex *lock, unsigned int subclass);
179 extern void mutex_lock(struct mutex *lock);
180 extern int __must_check mutex_lock_interruptible(struct mutex *lock);
181 extern int __must_check mutex_lock_killable(struct mutex *lock);
182 extern void mutex_lock_io(struct mutex *lock);
195 * Returns 1 if the mutex has been acquired successfully, and 0 on contention.
197 extern int mutex_trylock(struct mutex *lock);
198 extern void mutex_unlock(struct mutex *lock);
200 extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock);
214 * @lock: mutex to be locked
225 mutex_trylock_recursive(struct mutex *lock);