Lines Matching full:mutex
28 .\" from BSDI $Id: mutex.4,v 1.1.2.3 1998/04/27 22:53:13 ewv Exp $
34 .Nm mutex ,
61 .Fn mtx_init "struct mtx *mutex" "const char *name" "const char *type" "int opts"
63 .Fn mtx_destroy "struct mtx *mutex"
65 .Fn mtx_lock "struct mtx *mutex"
67 .Fn mtx_lock_spin "struct mtx *mutex"
69 .Fn mtx_lock_flags "struct mtx *mutex" "int flags"
71 .Fn mtx_lock_spin_flags "struct mtx *mutex" "int flags"
73 .Fn mtx_trylock "struct mtx *mutex"
75 .Fn mtx_trylock_flags "struct mtx *mutex" "int flags"
77 .Fn mtx_trylock_spin "struct mtx *mutex"
79 .Fn mtx_trylock_spin_flags "struct mtx *mutex" "int flags"
81 .Fn mtx_unlock "struct mtx *mutex"
83 .Fn mtx_unlock_spin "struct mtx *mutex"
85 .Fn mtx_unlock_flags "struct mtx *mutex" "int flags"
87 .Fn mtx_unlock_spin_flags "struct mtx *mutex" "int flags"
91 .Fn mtx_initialized "const struct mtx *mutex"
93 .Fn mtx_owned "const struct mtx *mutex"
95 .Fn mtx_recursed "const struct mtx *mutex"
100 .Fn mtx_assert "const struct mtx *mutex" "int what"
114 A thread must be able to recursively acquire a mutex,
115 provided that the mutex is initialized to support recursion.
128 the possible context switch introduced by acquiring a mutex is guaranteed
138 uncontested spin mutex is more expensive than the same operation
139 on a non-spin mutex.
145 Once a spin mutex has been acquired it is not permissible to acquire a
146 blocking mutex.
148 The storage needed to implement a mutex is provided by a
151 referenced only with the mutex primitives.
155 function must be used to initialize a mutex
156 before it can be passed to any of the other mutex functions.
162 option is used by the witness code to classify a mutex when doing checks
176 until the mutex is destroyed.
179 argument is used to set the type of mutex.
189 .Fa mutex
203 If another kernel thread is holding the mutex,
205 until the mutex is available
214 If another kernel thread is holding the mutex,
215 the caller will spin until the mutex becomes available.
219 It is possible for the same thread to recursively acquire a mutex
224 during the initialization of the mutex.
253 argument, then the mutex can be acquired recursively.
263 mutex, respectively, pointed to by
264 .Fa mutex .
265 If the mutex cannot be immediately acquired, the functions will return 0,
266 otherwise the mutex will be acquired and a non-zero value will be returned.
295 for the mutex.
307 functions behave in exactly the same way as do the standard mutex
314 is identical to its behavior in the mutex lock routines.
319 .Fa mutex
322 Any mutex which is destroyed
326 on a mutex when it is destroyed.
327 It is not permissible to hold the mutex recursively,
328 or have another thread blocked on the mutex
343 .Fa mutex
350 .Fa mutex .
352 .Fa mutex
358 .Fa mutex
361 .Fa mutex .
368 .Fa mutex .
378 holds the mutex
382 does not hold the mutex
385 Assert that the current thread has recursed on the mutex
390 Assert that the current thread has not recursed on the mutex
400 routine at system startup in order to initialize a given mutex lock.
406 .Ss The Default Mutex Type
419 .Ss The Spin Mutex Type
422 mutex will not relinquish the CPU
424 but will loop, waiting for the mutex to be released by another CPU.
426 if another thread interrupted the thread which held a mutex
427 and then tried to acquire the mutex.
440 specify the mutex type.
460 Specifies that the initialized mutex is allowed to recurse.
461 This bit must be present if the mutex is permitted to recurse.
468 that is, attempting to acquire an already-owned mutex fails.
470 Do not log any mutex operations for this lock.
502 Options that modify mutex behavior:
505 This option is used to quiet logging messages during individual mutex
517 holding another mutex.
524 Sleeping while holding a mutex (except for