Lines Matching refs:lock

89  * @lock: the mutex to be initialized
98 static inline void ww_mutex_init(struct ww_mutex *lock,
101 ww_mutex_base_init(&lock->base, ww_class->mutex_name, &ww_class->mutex_key);
102 lock->ctx = NULL;
104 lock->ww_class = ww_class;
116 * a given lock class. Deadlocks will be detected and handled with the
126 * to the usual locking rules between different lock classes.
161 * Marks the end of the acquire phase, any further w/w mutex lock calls using
207 * @lock: the mutex to be acquired
208 * @ctx: w/w acquire context, or NULL to acquire only a single lock.
213 * wait/die algorithm. If the lock isn't immediately available this function
216 * same lock with the same context twice is also detected and signalled by
220 * the given context and then wait for this contending lock to be available by
222 * lock and proceed with trying to acquire further w/w mutexes (e.g. when
230 * of the same w/w lock class as was used to initialize the acquire context.
234 extern int /* __must_check */ ww_mutex_lock(struct ww_mutex *lock, struct ww_acquire_ctx *ctx);
238 * @lock: the mutex to be acquired
244 * wait/die algorithm. If the lock isn't immediately available this function
247 * same lock with the same context twice is also detected and signalled by
249 * signal arrives while waiting for the lock then this function returns -EINTR.
252 * the given context and then wait for this contending lock to be available by
254 * not acquire this lock and proceed with trying to acquire further w/w mutexes
262 * of the same w/w lock class as was used to initialize the acquire context.
266 extern int __must_check ww_mutex_lock_interruptible(struct ww_mutex *lock,
271 * @lock: the mutex to be acquired
275 * will sleep until the lock becomes available.
278 * context and then call this function on the contended lock.
288 * Note that the slowpath lock acquiring can also be done by calling
293 ww_mutex_lock_slow(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
299 ret = ww_mutex_lock(lock, ctx);
305 * @lock: the mutex to be acquired
309 * will sleep until the lock becomes available and returns 0 when the lock has
310 * been acquired. If a signal arrives while waiting for the lock then this
314 * context and then call this function on the contended lock.
324 * Note that the slowpath lock acquiring can also be done by calling
329 ww_mutex_lock_slow_interruptible(struct ww_mutex *lock,
335 return ww_mutex_lock_interruptible(lock, ctx);
338 extern void ww_mutex_unlock(struct ww_mutex *lock);
340 extern int __must_check ww_mutex_trylock(struct ww_mutex *lock,
345 * @lock: the mutex to be destroyed
351 static inline void ww_mutex_destroy(struct ww_mutex *lock)
354 mutex_destroy(&lock->base);
360 * @lock: the mutex to be queried
364 static inline bool ww_mutex_is_locked(struct ww_mutex *lock)
366 return ww_mutex_base_is_locked(&lock->base);