| /src/sys/dev/drm2/ttm/ |
| H A D | ttm_lock.c | 48 void ttm_lock_init(struct ttm_lock *lock) in ttm_lock_init() argument 50 mtx_init(&lock->lock, "ttmlk", NULL, MTX_DEF); in ttm_lock_init() 51 lock->rw = 0; in ttm_lock_init() 52 lock->flags = 0; in ttm_lock_init() 53 lock->kill_takers = false; in ttm_lock_init() 54 lock->signal = SIGKILL; in ttm_lock_init() 68 void ttm_read_unlock(struct ttm_lock *lock) in ttm_read_unlock() argument 70 mtx_lock(&lock->lock); in ttm_read_unlock() 71 if (--lock->rw == 0) in ttm_read_unlock() 72 wakeup(lock); in ttm_read_unlock() [all …]
|
| H A D | ttm_lock.h | 33 * of the DRM heavyweight hardware lock. 34 * The lock is a read-write lock. Taking it in read mode and write mode 39 * It's allowed to leave kernel space with the vt lock held. 40 * If a user-space process dies while having the vt-lock, 41 * it will be released during the file descriptor release. The vt lock 42 * excludes write lock and read lock. 44 * The suspend mode is used to lock out all TTM users when preparing for 59 * @base: ttm base object used solely to release the lock if the client 60 * holding the lock dies. 61 * @queue: Queue for processes waiting for lock change-of-status. [all …]
|
| /src/contrib/unbound/testcode/ |
| H A D | checklocks.c | 50 * - debug status print, of thread lock stacks, and current waiting. 54 /** How long to wait before lock attempt is a failure. */ 67 /** stored maximum lock number for threads, when a thread is restarted the 77 * Should checklocks print a trace of the lock and unlock calls. 78 * It uses fprintf for that because the log function uses a lock and that 83 * Assume lock 0 0 (create_thread, create_instance), is the log lock and 84 * do not print for that. Otherwise the output is full of log lock accesses. 90 /** print pretty lock error and exit (decl for NORETURN attribute) */ 91 static void lock_error(struct checked_lock* lock, const char* func, 94 /** print pretty lock error and exit */ [all …]
|
| /src/share/man/man9/ |
| H A D | lock.9 | 53 .Fn lockinit "struct lock *lkp" "int prio" "const char *wmesg" "int timo" "int flags" 55 .Fn lockdestroy "struct lock *lkp" 57 .Fn lockmgr "struct lock *lkp" "u_int flags" "struct mtx *ilk" 59 .Fn lockmgr_args "struct lock *lkp" "u_int flags" "struct mtx *ilk" "const char *wmesg" "int prio" … 61 .Fn lockmgr_args_rw "struct lock *lkp" "u_int flags" "struct rwlock *ilk" "const char *wmesg" "int … 63 .Fn lockmgr_disown "struct lock *lkp" 65 .Fn lockmgr_disowned "const struct lock *lkp" 67 .Fn lockmgr_lock_flags "struct lock *lkp" "u_int flags" "struct lock_object *ilk" "const char *file… 69 .Fn lockmgr_printinfo "const struct lock *lkp" 71 .Fn lockmgr_recursed "const struct lock *lkp" [all …]
|
| H A D | sx.9 | 52 .Nd kernel shared/exclusive lock 117 shared/exclusive lock. 131 to ignore this lock. 133 Do not profile this lock. 138 Do not log any operations for this lock via 153 The lock 157 Threads acquire and release a shared lock by calling 166 Threads acquire and release an exclusive lock by calling 175 A thread can attempt to upgrade a currently held shared lock to an exclusive 176 lock by calling [all …]
|
| H A D | rmlock.9 | 51 .Nd kernel reader/writer lock optimized for read-mostly access patterns 109 Acquiring an exclusive lock after the lock has been locked for shared access 114 locks and follow the same lock ordering rules as 127 Readers can recurse if the lock is initialized with the 136 It changes lock ordering rules to the same as for 148 lock ordering. 152 Initialize the read-mostly lock 158 on the lock. 162 initialize the read-mostly lock 172 to ignore this lock. [all …]
|
| H A D | rwlock.9 | 48 .Nd kernel reader/writer lock 127 as reader/writer lock, described by name 131 on the lock. 133 Initialize the rw lock just like the 146 Do not profile this lock. 150 to ignore this lock. 152 Do not log any operations for this lock via 168 Lock 171 If any thread holds this lock exclusively, the current thread blocks, 179 .Dq "recursing on a lock" . [all …]
|
| /src/crypto/openssl/crypto/ |
| H A D | threads_win.c | 41 SRWLOCK lock; member 59 CRYPTO_RCU_LOCK *lock; member 107 /* lock protecting write side operations */ 110 /* lock protecting updates to writers_alloced/current_alloc_idx */ 116 /* lock to enforce in-order retirement */ 122 /* lock used with NO_INTERLOCKEDOR64: VS2010 x86 */ 126 static struct rcu_qp *allocate_new_qp_group(struct rcu_lock_st *lock, in allocate_new_qp_group() argument 131 lock->group_count = count; in allocate_new_qp_group() 183 void ossl_rcu_lock_free(CRYPTO_RCU_LOCK *lock) in ossl_rcu_lock_free() argument 185 CRYPTO_THREAD_lock_free(lock->rw_lock); in ossl_rcu_lock_free() [all …]
|
| H A D | threads_pthread.c | 185 * This is the core of an rcu lock. It tracks the readers and writers for the 186 * current quiescence point for a given lock. Users is the 64 bit value that 197 CRYPTO_RCU_LOCK *lock; member 245 /* lock protecting write side operations */ 248 /* lock protecting updates to writers_alloced/current_alloc_idx */ 254 /* lock to enforce in-order retirement */ 262 static struct rcu_qp *get_hold_current_qp(struct rcu_lock_st *lock) in get_hold_current_qp() argument 268 qp_idx = ATOMIC_LOAD_N(uint32_t, &lock->reader_idx, __ATOMIC_RELAXED); in get_hold_current_qp() 277 * of the lock is flushed from a local cpu cache so that we see any in get_hold_current_qp() 281 ATOMIC_ADD_FETCH(&lock->qp_group[qp_idx].users, (uint64_t)1, in get_hold_current_qp() [all …]
|
| H A D | threads_none.c | 30 struct rcu_lock_st *lock; in ossl_rcu_lock_new() local 32 lock = OPENSSL_zalloc(sizeof(*lock)); in ossl_rcu_lock_new() 33 return lock; in ossl_rcu_lock_new() 36 void ossl_rcu_lock_free(CRYPTO_RCU_LOCK *lock) in ossl_rcu_lock_free() argument 38 OPENSSL_free(lock); in ossl_rcu_lock_free() 41 void ossl_rcu_read_lock(CRYPTO_RCU_LOCK *lock) in ossl_rcu_read_lock() argument 46 void ossl_rcu_write_lock(CRYPTO_RCU_LOCK *lock) in ossl_rcu_write_lock() argument 51 void ossl_rcu_write_unlock(CRYPTO_RCU_LOCK *lock) in ossl_rcu_write_unlock() argument 56 void ossl_rcu_read_unlock(CRYPTO_RCU_LOCK *lock) in ossl_rcu_read_unlock() argument 61 void ossl_synchronize_rcu(CRYPTO_RCU_LOCK *lock) in ossl_synchronize_rcu() argument [all …]
|
| /src/contrib/unbound/util/ |
| H A D | locks.h | 49 * o lock_rw: lock that has many readers and one writer (to a data entry). 51 * This lock is meant for non performance sensitive uses. 52 * o lock_quick: speed lock. For performance sensitive locking of critical 86 #define lock_protect(lock, area, size) /* nop */ argument 87 #define lock_unprotect(lock, area) /* nop */ argument 88 #define lock_get_mem(lock) (0) /* nothing */ argument 98 /** use pthread mutex for basic lock */ 101 #define lock_basic_init(lock) LOCKRET(pthread_mutex_init(lock, NULL)) argument 102 #define lock_basic_destroy(lock) LOCKRET(pthread_mutex_destroy(lock)) argument 103 #define lock_basic_lock(lock) LOCKRET(pthread_mutex_lock(lock)) argument [all …]
|
| /src/contrib/libevent/ |
| H A D | evthread.c | 107 event_warnx("Trying to disable lock functions after " in evthread_set_lock_callbacks() 118 target->lock == cbs->lock && in evthread_set_lock_callbacks() 123 event_warnx("Can't change lock callbacks once they have been " in evthread_set_lock_callbacks() 127 if (cbs->alloc && cbs->free && cbs->lock && cbs->unlock) { in evthread_set_lock_callbacks() 189 * lock to protect count. */ 191 void *lock; member 201 if (!(result->lock = original_lock_fns_.alloc( in debug_lock_alloc() 207 result->lock = NULL; in debug_lock_alloc() 219 struct debug_lock *lock = lock_; in debug_lock_free() local 220 EVUTIL_ASSERT(lock->count == 0); in debug_lock_free() [all …]
|
| H A D | evthread-internal.h | 50 /* Global function pointers to lock-related functions. NULL if locking isn't 65 * running a given event_base's loop. Requires lock. */ 72 * thread. Requires lock. */ 78 /** Allocate a new lock, and store it in lockvar, a void*. Sets lockvar to 84 /** Free a given lock, if it is present and locking is enabled. */ 92 /** Acquire a lock. */ 96 evthread_lock_fns_.lock(mode, lockvar); \ 99 /** Release a lock */ 116 /** Lock an event_base, if it is set up for locking. Acquires the lock 127 /** If lock debugging is enabled, and lock is non-null, assert that 'lock' is [all …]
|
| /src/contrib/ntp/sntp/libevent/ |
| H A D | evthread.c | 107 event_warnx("Trying to disable lock functions after " in evthread_set_lock_callbacks() 118 target->lock == cbs->lock && in evthread_set_lock_callbacks() 123 event_warnx("Can't change lock callbacks once they have been " in evthread_set_lock_callbacks() 127 if (cbs->alloc && cbs->free && cbs->lock && cbs->unlock) { in evthread_set_lock_callbacks() 189 * lock to protect count. */ 191 void *lock; member 201 if (!(result->lock = original_lock_fns_.alloc( in debug_lock_alloc() 207 result->lock = NULL; in debug_lock_alloc() 219 struct debug_lock *lock = lock_; in debug_lock_free() local 220 EVUTIL_ASSERT(lock->count == 0); in debug_lock_free() [all …]
|
| H A D | evthread-internal.h | 50 /* Global function pointers to lock-related functions. NULL if locking isn't 65 * running a given event_base's loop. Requires lock. */ 72 * thread. Requires lock. */ 78 /** Allocate a new lock, and store it in lockvar, a void*. Sets lockvar to 84 /** Free a given lock, if it is present and locking is enabled. */ 92 /** Acquire a lock. */ 96 evthread_lock_fns_.lock(mode, lockvar); \ 99 /** Release a lock */ 116 /** Lock an event_base, if it is set up for locking. Acquires the lock 127 /** If lock debugging is enabled, and lock is non-null, assert that 'lock' is [all …]
|
| /src/sys/dev/drm2/ |
| H A D | drm_lock.c | 46 * Lock ioctl. 54 * Add the current task to the lock wait queue, and attempt to take to lock. 58 struct drm_lock *lock = data; in drm_lock() local 64 if (lock->context == DRM_KERNEL_CONTEXT) { in drm_lock() 66 DRM_CURRENTPID, lock->context); in drm_lock() 70 DRM_DEBUG("%d (pid %d) requests lock (0x%08x), flags = 0x%08x\n", in drm_lock() 71 lock->context, DRM_CURRENTPID, in drm_lock() 72 master->lock.hw_lock->lock, lock->flags); in drm_lock() 74 mtx_lock(&master->lock.spinlock); in drm_lock() 75 master->lock.user_waiters++; in drm_lock() [all …]
|
| /src/sys/sys/ |
| H A D | lock.h | 44 * Lock classes. Each lock has a class which describes characteristics 48 * an error to perform any type of context switch while holding a spin lock. 49 * Also, for an individual lock to be recursable, its class must allow 50 * recursion and the lock itself must explicitly allow recursion. 53 * data for the 'show lock' DDB command. The 'lc_lock' and 55 * to lock and unlock locks while blocking on a sleep queue. The 63 void (*lc_assert)(const struct lock_object *lock, int what); 64 void (*lc_ddb_show)(const struct lock_object *lock); 65 void (*lc_lock)(struct lock_object *lock, uintptr_t how); 66 int (*lc_owner)(const struct lock_object *lock, [all …]
|
| /src/crypto/heimdal/lib/hx509/ |
| H A D | lock.c | 60 hx509_lock_init(hx509_context context, hx509_lock *lock) in hx509_lock_init() argument 65 *lock = NULL; in hx509_lock_init() 81 *lock = l; in hx509_lock_init() 87 hx509_lock_add_password(hx509_lock lock, const char *password) in hx509_lock_add_password() argument 96 d = realloc(lock->password.val, in hx509_lock_add_password() 97 (lock->password.len + 1) * sizeof(lock->password.val[0])); in hx509_lock_add_password() 102 lock->password.val = d; in hx509_lock_add_password() 103 lock->password.val[lock->password.len] = s; in hx509_lock_add_password() 104 lock->password.len++; in hx509_lock_add_password() 110 _hx509_lock_get_passwords(hx509_lock lock) in _hx509_lock_get_passwords() argument [all …]
|
| /src/sys/kern/ |
| H A D | kern_lockf.c | 70 #include <sys/lock.h> 172 * This structure is used to keep track of both local and remote lock 174 * the lock owner structure. Each possible lock owner (local proc for 179 * If a lock owner has a lock that blocks some other lock or a lock 180 * that is waiting for some other lock, it also has a vertex in the 196 pid_t lo_pid; /* (c) Process Id of the lock owner */ 197 int lo_sysid; /* (c) System Id of the lock owner */ 198 int lo_hash; /* (c) Used to lock the appropriate chain */ 205 struct sx lock; member 220 * lock that prevents the lock from being granted and also to each [all …]
|
| H A D | kern_rangelock.c | 36 #include <sys/lock.h> 64 * Lock is in cheat mode when RL_CHEAT_CHEATING bit is set in the 65 * lock->head. Special cookies are returned in this mode, and 86 rangelock_cheat_drain(struct rangelock *lock) in rangelock_cheat_drain() argument 92 v = atomic_load_ptr(&lock->head); in rangelock_cheat_drain() 95 sleepq_add(&lock->head, NULL, "ranged1", 0, 0); in rangelock_cheat_drain() 96 sleepq_wait(&lock->head, PRI_USER); in rangelock_cheat_drain() 97 sleepq_lock(&lock->head); in rangelock_cheat_drain() 99 sleepq_release(&lock->head); in rangelock_cheat_drain() 104 rangelock_cheat_lock(struct rangelock *lock, int locktype, bool trylock, in rangelock_cheat_lock() argument [all …]
|
| /src/sys/cddl/compat/opensolaris/sys/ |
| H A D | rwlock.h | 32 #include <sys/lock.h> 59 #define rw_init(lock, desc, type, arg) do { \ argument 62 KASSERT(((lock)->lock_object.lo_flags & LO_ALLMASK) != \ 63 LO_EXPECTED, ("lock %s already initialized", #lock)); \ 64 bzero((lock), sizeof(struct sx)); \ 65 for (_name = #lock; *_name != '\0'; _name++) { \ 70 _name = #lock; \ 71 sx_init_flags((lock), _name, RW_FLAGS); \ 73 #define rw_destroy(lock) sx_destroy(lock) argument 74 #define rw_enter(lock, how) do { \ argument [all …]
|
| /src/sbin/hastd/ |
| H A D | synch.h | 48 mtx_init(pthread_mutex_t *lock) __requires_unlocked(*lock) in mtx_init() argument 52 error = pthread_mutex_init(lock, NULL); in mtx_init() 56 mtx_destroy(pthread_mutex_t *lock) __requires_unlocked(*lock) in mtx_destroy() argument 60 error = pthread_mutex_destroy(lock); in mtx_destroy() 64 mtx_lock(pthread_mutex_t *lock) __locks_exclusive(*lock) in mtx_lock() argument 68 error = pthread_mutex_lock(lock); in mtx_lock() 72 mtx_trylock(pthread_mutex_t *lock) __trylocks_exclusive(true, *lock) in mtx_trylock() argument 76 error = pthread_mutex_trylock(lock); in mtx_trylock() 81 mtx_unlock(pthread_mutex_t *lock) __unlocks(*lock) in mtx_unlock() argument 85 error = pthread_mutex_unlock(lock); in mtx_unlock() [all …]
|
| /src/share/man/man4/ |
| H A D | dtrace_lockstat.4 | 51 .Fn lockstat:::lockmgr-acquire "struct lock *" "int" 52 .Fn lockstat:::lockmgr-release "struct lock *" "int" 53 .Fn lockstat:::lockmgr-disown "struct lock *" "int" 54 .Fn lockstat:::lockmgr-block "struct lock *" "uint64_t" "int" "int" "int" 55 .Fn lockstat:::lockmgr-upgrade "struct lock *" 56 .Fn lockstat:::lockmgr-downgrade "struct lock *" 66 provider contains DTrace probes for inspecting kernel lock 74 lock types. 80 Each type of lock has 84 probes which expose the lock structure being operated upon, [all …]
|
| /src/sys/contrib/openzfs/include/os/freebsd/spl/sys/ |
| H A D | rwlock.h | 35 #include <sys/lock.h> 61 #define rw_init(lock, desc, type, arg) do { \ argument 64 for (_name = #lock; *_name != '\0'; _name++) { \ 69 _name = #lock; \ 70 sx_init_flags((lock), _name, RW_FLAGS); \ 72 #define rw_destroy(lock) sx_destroy(lock) argument 73 #define rw_enter(lock, how) do { \ argument 75 sx_slock(lock); \ 77 sx_xlock(lock); \ 80 #define rw_tryenter(lock, how) \ argument [all …]
|
| /src/usr.bin/lockf/ |
| H A D | lockf.1 | 30 .Nd execute a command while holding a file lock 45 utility acquires an exclusive lock on a 51 While holding the lock, it executes a 59 releases the lock, and removes the 69 is not considered to constitute a lock. 90 This can be used to lock inside a shell script. 98 This will guarantee lock ordering, as well as implement 104 option is not used, then no guarantees around lock ordering can be made. 109 Causes the lock file to be kept (not removed) after the command 115 Failure to acquire the lock is indicated only in the exit status. [all …]
|