| /freebsd/sys/dev/drm2/ttm/ | 
| H A D | ttm_lock.c | 48 void ttm_lock_init(struct ttm_lock *lock)  in ttm_lock_init()  argument50 	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 …]
 
 | 
| /freebsd/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 lock117 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 patterns109 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 lock127 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 …]
 
 | 
| /freebsd/crypto/openssl/crypto/ | 
| H A D | threads_win.c | 41     SRWLOCK lock;  member59     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
 132     lock->group_count = count;  in allocate_new_qp_group()
 185 void ossl_rcu_lock_free(CRYPTO_RCU_LOCK *lock)  in ossl_rcu_lock_free()  argument
 187     CRYPTO_THREAD_lock_free(lock->rw_lock);  in ossl_rcu_lock_free()
 [all …]
 
 | 
| H A D | threads_pthread.c | 183  * This is the core of an rcu lock. It tracks the readers and writers for the184  * current quiescence point for a given lock. Users is the 64 bit value that
 195     CRYPTO_RCU_LOCK *lock;  member
 243     /* lock protecting write side operations */
 246     /* lock protecting updates to writers_alloced/current_alloc_idx */
 252     /* lock to enforce in-order retirement */
 260 static struct rcu_qp *get_hold_current_qp(struct rcu_lock_st *lock)  in get_hold_current_qp()  argument
 266         qp_idx = ATOMIC_LOAD_N(uint32_t, &lock->reader_idx, __ATOMIC_RELAXED);  in get_hold_current_qp()
 275          * of the lock is flushed from a local cpu cache so that we see any  in get_hold_current_qp()
 279         ATOMIC_ADD_FETCH(&lock->qp_group[qp_idx].users, (uint64_t)1,  in get_hold_current_qp()
 [all …]
 
 | 
| H A D | threads_none.c | 29     struct rcu_lock_st *lock;  in ossl_rcu_lock_new()  local31     lock = OPENSSL_zalloc(sizeof(*lock));  in ossl_rcu_lock_new()
 32     return lock;  in ossl_rcu_lock_new()
 35 void ossl_rcu_lock_free(CRYPTO_RCU_LOCK *lock)  in ossl_rcu_lock_free()  argument
 37     OPENSSL_free(lock);  in ossl_rcu_lock_free()
 40 void ossl_rcu_read_lock(CRYPTO_RCU_LOCK *lock)  in ossl_rcu_read_lock()  argument
 45 void ossl_rcu_write_lock(CRYPTO_RCU_LOCK *lock)  in ossl_rcu_write_lock()  argument
 50 void ossl_rcu_write_unlock(CRYPTO_RCU_LOCK *lock)  in ossl_rcu_write_unlock()  argument
 55 void ossl_rcu_read_unlock(CRYPTO_RCU_LOCK *lock)  in ossl_rcu_read_unlock()  argument
 60 void ossl_synchronize_rcu(CRYPTO_RCU_LOCK *lock)  in ossl_synchronize_rcu()  argument
 [all …]
 
 | 
| /freebsd/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 …]
 
 | 
| /freebsd/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't65  * 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 …]
 
 | 
| /freebsd/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't65  * 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 …]
 
 | 
| /freebsd/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 …]
 
 | 
| /freebsd/sys/sys/ | 
| H A D | lock.h | 44  * Lock classes.  Each lock has a class which describes characteristics48  * 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 …]
 
 | 
| /freebsd/crypto/heimdal/lib/hx509/ | 
| H A D | lock.c | 60 hx509_lock_init(hx509_context context, hx509_lock *lock)  in hx509_lock_init()  argument65     *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 …]
 
 | 
| /freebsd/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 …]
 
 | 
| /freebsd/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 …]
 
 | 
| /freebsd/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 …]
 
 | 
| /freebsd/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 …]
 
 | 
| /freebsd/usr.bin/lockf/ | 
| H A D | lockf.1 | 30 .Nd execute a command while holding a file lock45 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 …]
 
 | 
| /freebsd/contrib/llvm-project/openmp/runtime/src/ | 
| H A D | kmp_lock.h | 2  * kmp_lock.h -- lock header file49 // intel archs.  It allocates at least 8 bytes for nested lock (more on
 67 // lock flags
 72 // When a lock table is used, the indices are of kmp_lock_index_t
 75 // When memory allocated for locks are on the lock pool (free list),
 87 //  There are 5 lock implementations:
 95 //   and 3 lock purposes:
 104 // Lock implementations.
 108 // Non-nested test and set locks differ from the other lock kinds (except
 109 // futex) in that we use the memory allocated by the compiler for the lock,
 139 KMP_TAS_LOCK_INITIALIZER(lock) global()  argument
 198 KMP_FUTEX_LOCK_INITIALIZER(lock) global()  argument
 277 KMP_TICKET_LOCK_INITIALIZER(lock) global()  argument
 515 KMP_BOOTSTRAP_LOCK_INITIALIZER(lock) global()  argument
 516 KMP_BOOTSTRAP_LOCK_INIT(lock) global()  argument
 549 KMP_LOCK_INIT(lock) global()  argument
 1119 kmp_user_lock_p lock; global()  member
 [all...]
 | 
| /freebsd/contrib/ofed/opensm/include/complib/ | 
| H A D | cl_passivelock.h | 38  *	This file contains the passive lock, which synchronizes passive threads.39  *	The passive lock allows multiple readers to access a resource
 58 /****h* Component Library/Passive Lock
 60 *	Passive Lock
 63 *	The Passive Lock provides synchronization between multiple threads that
 64 *	are sharing the lock with a single thread holding the lock exclusively.
 66 *	Passive lock works exclusively between threads and cannot be used in
 69 *	The passive lock functions operate a cl_plock_t structure which should
 83 /****s* Component Library: Passive Lock/cl_plock_t
 88 *	Passive Lock structure.
 [all …]
 
 |