Lines Matching full:mutex
5 * Original mutex implementation started by Ingo Molnar:
20 #include <linux/mutex.h>
29 #define WW_MUTEX_BASE mutex
98 * ww_mutex_init - initialize the w/w mutex
99 * @lock: the mutex to be initialized
100 * @ww_class: the w/w class the mutex should belong to
102 * Initialize the w/w mutex to unlocked state and associate it with the given
103 * class. Static define macro for w/w mutex is not provided and this function
104 * is the only way to properly initialize the w/w mutex.
106 * It is not allowed to initialize an already locked mutex.
125 * Context-based w/w mutex acquiring can be done in any order whatsoever within
129 * Mixing of context-based w/w mutex acquiring and single w/w mutex locking can
174 * Marks the end of the acquire phase, any further w/w mutex lock calls using
177 * Calling this function is optional, it is just useful to document w/w mutex
220 * ww_mutex_lock - acquire the w/w mutex
221 * @lock: the mutex to be acquired
224 * Lock the w/w mutex exclusively for this task.
231 * returning -EALREADY. Returns 0 if the mutex was successfully acquired.
239 * The mutex must later on be released by the same task that
240 * acquired it. The task may not exit without first unlocking the mutex. Also,
241 * kernel memory where the mutex resides must not be freed with the mutex still
242 * locked. The mutex must first be initialized (or statically defined) before it
243 * can be locked. memset()-ing the mutex to 0 is not allowed. The mutex must be
246 * A mutex acquired with this function must be released with ww_mutex_unlock.
251 * ww_mutex_lock_interruptible - acquire the w/w mutex, interruptible
252 * @lock: the mutex to be acquired
255 * Lock the w/w mutex exclusively for this task.
262 * returning -EALREADY. Returns 0 if the mutex was successfully acquired. If a
271 * The mutex must later on be released by the same task that
272 * acquired it. The task may not exit without first unlocking the mutex. Also,
273 * kernel memory where the mutex resides must not be freed with the mutex still
274 * locked. The mutex must first be initialized (or statically defined) before it
275 * can be locked. memset()-ing the mutex to 0 is not allowed. The mutex must be
278 * A mutex acquired with this function must be released with ww_mutex_unlock.
284 * ww_mutex_lock_slow - slowpath acquiring of the w/w mutex
285 * @lock: the mutex to be acquired
288 * Acquires a w/w mutex with the given context after a die case. This function
296 * ww_mutex_lock can be used to avoid locking this contended mutex twice.
300 * contending mutex.
303 * ww_mutex_lock directly. This function here is simply to help w/w mutex
318 * ww_mutex_lock_slow_interruptible - slowpath acquiring of the w/w mutex, interruptible
319 * @lock: the mutex to be acquired
322 * Acquires a w/w mutex with the given context after a die case. This function
332 * ww_mutex_lock can be used to avoid locking this contended mutex twice.
336 * than the contending mutex.
340 * w/w mutex locking code readability by clearly denoting the slowpath.
358 * ww_mutex_destroy - mark a w/w mutex unusable
359 * @lock: the mutex to be destroyed
361 * This function marks the mutex uninitialized, and any subsequent
362 * use of the mutex is forbidden. The mutex must not be locked when
373 * ww_mutex_is_locked - is the w/w mutex locked
374 * @lock: the mutex to be queried
376 * Returns 1 if the mutex is locked, 0 if unlocked.