| /freebsd-13-stable/sys/dev/drm2/ttm/ |
| HD | 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 …]
|
| HD | 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-13-stable/contrib/unbound/util/ |
| HD | 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-13-stable/share/man/man9/ |
| HD | lock.9 | 48 .Fn lockinit "struct lock *lkp" "int prio" "const char *wmesg" "int timo" "int flags" 50 .Fn lockdestroy "struct lock *lkp" 52 .Fn lockmgr "struct lock *lkp" "u_int flags" "struct mtx *ilk" 54 .Fn lockmgr_args "struct lock *lkp" "u_int flags" "struct mtx *ilk" "const char *wmesg" "int prio" … 56 .Fn lockmgr_args_rw "struct lock *lkp" "u_int flags" "struct rwlock *ilk" "const char *wmesg" "int … 58 .Fn lockmgr_disown "struct lock *lkp" 60 .Fn lockmgr_printinfo "const struct lock *lkp" 62 .Fn lockmgr_recursed "const struct lock *lkp" 64 .Fn lockmgr_rw "struct lock *lkp" "u_int flags" "struct rwlock *ilk" 66 .Fn lockstatus "const struct lock *lkp" [all …]
|
| HD | 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 …]
|
| HD | 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 …]
|
| HD | 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 …]
|
| /freebsd-13-stable/contrib/libevent/ |
| HD | 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 …]
|
| HD | 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 …]
|
| /freebsd-13-stable/contrib/ntp/sntp/libevent/ |
| HD | 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 …]
|
| HD | 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 …]
|
| /freebsd-13-stable/sys/dev/drm2/ |
| HD | 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-13-stable/sys/sys/ |
| HD | 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 …]
|
| /freebsd-13-stable/crypto/heimdal/lib/hx509/ |
| HD | 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 …]
|
| /freebsd-13-stable/sys/kern/ |
| HD | kern_lockf.c | 72 #include <sys/lock.h> 174 * This structure is used to keep track of both local and remote lock 176 * the lock owner structure. Each possible lock owner (local proc for 181 * If a lock owner has a lock that blocks some other lock or a lock 182 * that is waiting for some other lock, it also has a vertex in the 198 pid_t lo_pid; /* (c) Process Id of the lock owner */ 199 int lo_sysid; /* (c) System Id of the lock owner */ 200 int lo_hash; /* (c) Used to lock the appropriate chain */ 207 struct sx lock; member 222 * lock that prevents the lock from being granted and also to each [all …]
|
| /freebsd-13-stable/sys/contrib/octeon-sdk/ |
| HD | cvmx-spinlock.h | 89 * @param lock Lock to initialize 91 static inline void cvmx_spinlock_init(cvmx_spinlock_t *lock) in cvmx_spinlock_init() argument 93 lock->value = CVMX_SPINLOCK_UNLOCKED_VAL; in cvmx_spinlock_init() 100 * @param lock Lock to check 103 static inline int cvmx_spinlock_locked(cvmx_spinlock_t *lock) in cvmx_spinlock_locked() argument 105 return (lock->value != CVMX_SPINLOCK_UNLOCKED_VAL); in cvmx_spinlock_locked() 110 * Releases lock 112 * @param lock pointer to lock structure 114 static inline void cvmx_spinlock_unlock(cvmx_spinlock_t *lock) in cvmx_spinlock_unlock() argument 117 lock->value = 0; in cvmx_spinlock_unlock() [all …]
|
| HD | cvmx-rwlock.h | 67 /* Flags for lock value in rw lock structure */ 73 * is waiting, no readers are given the lock until all writers are done. 77 volatile uint32_t lock; member 83 * Initialize a reader/writer lock. This must be done 86 * @param lock pointer to rwlock structure 88 static inline void cvmx_rwlock_wp_init(cvmx_rwlock_wp_lock_t *lock) in cvmx_rwlock_wp_init() argument 90 lock->lock = 0; in cvmx_rwlock_wp_init() 91 lock->write_req = 0; in cvmx_rwlock_wp_init() 92 lock->write_comp = 0; in cvmx_rwlock_wp_init() 96 * Perform a reader lock. If a writer is pending, this [all …]
|
| /freebsd-13-stable/sys/contrib/openzfs/include/os/freebsd/spl/sys/ |
| HD | rwlock.h | 34 #include <sys/lock.h> 61 #define rw_init(lock, desc, type, arg) do { \ argument 64 KASSERT(((lock)->lock_object.lo_flags & LO_ALLMASK) != \ 65 LO_EXPECTED, ("lock %s already initialized", #lock)); \ 66 bzero((lock), sizeof(struct sx)); \ 67 for (_name = #lock; *_name != '\0'; _name++) { \ 72 _name = #lock; \ 73 sx_init_flags((lock), _name, RW_FLAGS); \ 75 #define rw_destroy(lock) sx_destroy(lock) argument 76 #define rw_enter(lock, how) do { \ argument [all …]
|
| /freebsd-13-stable/sys/cddl/compat/opensolaris/sys/ |
| HD | 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-13-stable/sbin/hastd/ |
| HD | 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 …]
|
| /freebsd-13-stable/share/man/man4/ |
| HD | 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-13-stable/contrib/subversion/subversion/libsvn_fs_x/ |
| HD | lock.c | 1 /* lock.c : functions for manipulating filesystem locks. 36 #include "lock.h" 48 /* Names of hash keys used to store a lock for writing to disk. */ 129 /* Return the path of the lock/entries file for which DIGEST is the 142 /* Set *DIGEST_PATH to the path to the lock/entries digest file associate 143 with PATH, where PATH is the path to the lock file or lock entries file 163 no children) and LOCK (which may be NULL if that versioned path is 164 lock itself locked). Set the permissions of DIGEST_PATH to those of 169 svn_lock_t *lock, in write_digest_file() argument 188 if (lock) in write_digest_file() [all …]
|
| /freebsd-13-stable/contrib/subversion/subversion/libsvn_fs_fs/ |
| HD | lock.c | 1 /* lock.c : functions for manipulating filesystem locks. 36 #include "lock.h" 47 /* Names of hash keys used to store a lock for writing to disk. */ 127 /* Return the path of the lock/entries file for which DIGEST is the 140 /* Set *DIGEST_PATH to the path to the lock/entries digest file associate 141 with PATH, where PATH is the path to the lock file or lock entries file 161 no children) and LOCK (which may be NULL if that versioned path is 162 lock itself locked). Set the permissions of DIGEST_PATH to those of 167 svn_lock_t *lock, in write_digest_file() argument 184 if (lock) in write_digest_file() [all …]
|
| /freebsd-13-stable/usr.bin/lockf/ |
| HD | 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 …]
|
| /freebsd-13-stable/contrib/llvm-project/openmp/runtime/src/ |
| HD | kmp_lock.h | 2 * kmp_lock.h -- lock header file 49 // 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, [all …]
|