Lines Matching full:mutex
5 * Original mutex implementation started by Ingo Molnar:
20 #include <linux/mutex.h>
29 #define WW_MUTEX_BASE mutex
88 * ww_mutex_init - initialize the w/w mutex
89 * @lock: the mutex to be initialized
90 * @ww_class: the w/w class the mutex should belong to
92 * Initialize the w/w mutex to unlocked state and associate it with the given
93 * class. Static define macro for w/w mutex is not provided and this function
94 * is the only way to properly initialize the w/w mutex.
96 * It is not allowed to initialize an already locked mutex.
115 * Context-based w/w mutex acquiring can be done in any order whatsoever within
119 * Mixing of context-based w/w mutex acquiring and single w/w mutex locking can
161 * Marks the end of the acquire phase, any further w/w mutex lock calls using
164 * Calling this function is optional, it is just useful to document w/w mutex
206 * ww_mutex_lock - acquire the w/w mutex
207 * @lock: the mutex to be acquired
210 * Lock the w/w mutex exclusively for this task.
217 * returning -EALREADY. Returns 0 if the mutex was successfully acquired.
225 * The mutex must later on be released by the same task that
226 * acquired it. The task may not exit without first unlocking the mutex. Also,
227 * kernel memory where the mutex resides must not be freed with the mutex still
228 * locked. The mutex must first be initialized (or statically defined) before it
229 * can be locked. memset()-ing the mutex to 0 is not allowed. The mutex must be
232 * A mutex acquired with this function must be released with ww_mutex_unlock.
237 * ww_mutex_lock_interruptible - acquire the w/w mutex, interruptible
238 * @lock: the mutex to be acquired
241 * Lock the w/w mutex exclusively for this task.
248 * returning -EALREADY. Returns 0 if the mutex was successfully acquired. If a
257 * The mutex must later on be released by the same task that
258 * acquired it. The task may not exit without first unlocking the mutex. Also,
259 * kernel memory where the mutex resides must not be freed with the mutex still
260 * locked. The mutex must first be initialized (or statically defined) before it
261 * can be locked. memset()-ing the mutex to 0 is not allowed. The mutex must be
264 * A mutex acquired with this function must be released with ww_mutex_unlock.
270 * ww_mutex_lock_slow - slowpath acquiring of the w/w mutex
271 * @lock: the mutex to be acquired
274 * Acquires a w/w mutex with the given context after a die case. This function
282 * ww_mutex_lock can be used to avoid locking this contended mutex twice.
286 * contending mutex.
289 * ww_mutex_lock directly. This function here is simply to help w/w mutex
304 * ww_mutex_lock_slow_interruptible - slowpath acquiring of the w/w mutex, interruptible
305 * @lock: the mutex to be acquired
308 * Acquires a w/w mutex with the given context after a die case. This function
318 * ww_mutex_lock can be used to avoid locking this contended mutex twice.
322 * than the contending mutex.
326 * w/w mutex locking code readability by clearly denoting the slowpath.
344 * ww_mutex_destroy - mark a w/w mutex unusable
345 * @lock: the mutex to be destroyed
347 * This function marks the mutex uninitialized, and any subsequent
348 * use of the mutex is forbidden. The mutex must not be locked when
359 * ww_mutex_is_locked - is the w/w mutex locked
360 * @lock: the mutex to be queried
362 * Returns 1 if the mutex is locked, 0 if unlocked.