Lines Matching defs:lock
8 * lock debugging, locking tree, deadlock detection started by:
27 * Must be called with lock->wait_lock held.
29 void debug_mutex_lock_common(struct mutex *lock, struct mutex_waiter *waiter)
37 void debug_mutex_wake_waiter(struct mutex *lock, struct mutex_waiter *waiter)
39 lockdep_assert_held(&lock->wait_lock);
40 DEBUG_LOCKS_WARN_ON(list_empty(&lock->wait_list));
51 void debug_mutex_add_waiter(struct mutex *lock, struct mutex_waiter *waiter,
54 lockdep_assert_held(&lock->wait_lock);
56 /* Mark the current thread as blocked on the lock: */
60 void debug_mutex_remove_waiter(struct mutex *lock, struct mutex_waiter *waiter,
72 void debug_mutex_unlock(struct mutex *lock)
75 DEBUG_LOCKS_WARN_ON(lock->magic != lock);
76 DEBUG_LOCKS_WARN_ON(!lock->wait_list.prev && !lock->wait_list.next);
80 void debug_mutex_init(struct mutex *lock, const char *name,
85 * Make sure we are not reinitializing a held lock:
87 debug_check_no_locks_freed((void *)lock, sizeof(*lock));
88 lockdep_init_map_wait(&lock->dep_map, name, key, 0, LD_WAIT_SLEEP);
90 lock->magic = lock;
98 int __devm_mutex_init(struct device *dev, struct mutex *lock)
100 return devm_add_action_or_reset(dev, devm_mutex_release, lock);
106 * @lock: the mutex to be destroyed
112 void mutex_destroy(struct mutex *lock)
114 DEBUG_LOCKS_WARN_ON(mutex_is_locked(lock));
115 lock->magic = NULL;