Lines Matching refs:mutex
26 Mutexes are represented by 'struct mutex', defined in include/linux/mutex.h
27 and implemented in kernel/locking/mutex.c. These locks use an atomic variable
37 When acquiring a mutex, there are three possible paths that can be
49 soon. The mutex spinners are queued up using MCS lock so that only
50 one spinner can compete for the mutex.
61 waiting to spin on mutex owner, only to go directly to slowpath upon
78 The mutex subsystem checks and enforces the following rules:
80 - Only one task can hold the mutex at a time.
81 - Only the owner can unlock the mutex.
84 - A mutex must only be initialized via the API (see below).
85 - A task may not exit with a mutex held.
92 In addition, the mutex debugging code also implements a number of other
113 mutex_unlock() may access the mutex structure even after it has internally
115 acquire the mutex and assume that the mutex_unlock() context is not using
118 The mutex user must ensure that the mutex is not destroyed while a
120 mutex_unlock() must ensure that the mutex stays alive until mutex_unlock()
125 Statically define the mutex::
129 Dynamically initialize the mutex::
131 mutex_init(mutex);
133 Acquire the mutex, uninterruptible::
135 void mutex_lock(struct mutex *lock);
136 void mutex_lock_nested(struct mutex *lock, unsigned int subclass);
137 int mutex_trylock(struct mutex *lock);
139 Acquire the mutex, interruptible::
141 int mutex_lock_interruptible_nested(struct mutex *lock,
143 int mutex_lock_interruptible(struct mutex *lock);
145 Acquire the mutex, interruptible, if dec to 0::
147 int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock);
149 Unlock the mutex::
151 void mutex_unlock(struct mutex *lock);
153 Test if the mutex is taken::
155 int mutex_is_locked(struct mutex *lock);
160 Unlike its original design and purpose, 'struct mutex' is among the largest