Home
last modified time | relevance | path

Searched full:lock (Results 1 – 25 of 3023) sorted by relevance

12345678910>>...121

/freebsd/sys/dev/drm2/ttm/
H A Dttm_lock.c48 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 Dttm_lock.h33 * 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 Dlock.953 .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 Dsx.952 .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 Drmlock.951 .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 Drwlock.948 .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/contrib/unbound/util/
H A Dlocks.h49 * 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 Devthread.c107 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 Devthread-internal.h50 /* 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/contrib/libevent/
H A Devthread.c107 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 Devthread-internal.h50 /* 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/sys/dev/drm2/
H A Ddrm_lock.c46 * 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 Dlock.h44 * 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/crypto/heimdal/lib/hx509/
H A Dlock.c60 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/sys/kern/
H A Dkern_lockf.c70 #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 Dkern_rangelock.c36 #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 …]
H A Dkern_condvar.c35 #include <sys/lock.h>
65 #define CV_ASSERT(cvp, lock, td) do { \ argument
69 KASSERT((lock) != NULL, ("%s: lock NULL", __func__)); \
108 _cv_wait(struct cv *cvp, struct lock_object *lock) in _cv_wait() argument
119 CV_ASSERT(cvp, lock, td); in _cv_wait()
120 WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, in _cv_wait()
135 class = LOCK_CLASS(lock); in _cv_wait()
140 if (lock == &Giant.lock_object) in _cv_wait()
144 sleepq_add(cvp, lock, cv in _cv_wait()
171 _cv_wait_unlock(struct cv * cvp,struct lock_object * lock) _cv_wait_unlock() argument
228 _cv_wait_sig(struct cv * cvp,struct lock_object * lock) _cv_wait_sig() argument
296 _cv_timedwait_sbt(struct cv * cvp,struct lock_object * lock,sbintime_t sbt,sbintime_t pr,int flags) _cv_timedwait_sbt() argument
366 _cv_timedwait_sig_sbt(struct cv * cvp,struct lock_object * lock,sbintime_t sbt,sbintime_t pr,int flags) _cv_timedwait_sig_sbt() argument
[all...]
/freebsd/sys/cddl/compat/opensolaris/sys/
H A Drwlock.h32 #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 Ddtrace_lockstat.451 .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/crypto/openssl/crypto/
H A Dthreads_win.c35 SRWLOCK lock; member
42 CRYPTO_RWLOCK *lock; in CRYPTO_THREAD_lock_new() local
46 if ((lock = OPENSSL_zalloc(sizeof(CRYPTO_win_rwlock))) == NULL) in CRYPTO_THREAD_lock_new()
48 rwlock = lock; in CRYPTO_THREAD_lock_new()
49 InitializeSRWLock(&rwlock->lock); in CRYPTO_THREAD_lock_new()
52 if ((lock = OPENSSL_zalloc(sizeof(CRITICAL_SECTION))) == NULL) { in CRYPTO_THREAD_lock_new()
59 if (!InitializeCriticalSectionAndSpinCount(lock, 0x400)) { in CRYPTO_THREAD_lock_new()
60 OPENSSL_free(lock); in CRYPTO_THREAD_lock_new()
64 InitializeCriticalSection(lock); in CRYPTO_THREAD_lock_new()
68 return lock; in CRYPTO_THREAD_lock_new()
[all …]
/freebsd/sys/contrib/openzfs/include/os/freebsd/spl/sys/
H A Drwlock.h34 #include <sys/lock.h>
60 #define rw_init(lock, desc, type, arg) do { \ argument
63 for (_name = #lock; *_name != '\0'; _name++) { \
68 _name = #lock; \
69 sx_init_flags((lock), _name, RW_FLAGS); \
71 #define rw_destroy(lock) sx_destroy(lock) argument
72 #define rw_enter(lock, how) do { \ argument
74 sx_slock(lock); \
76 sx_xlock(lock); \
79 #define rw_tryenter(lock, how) \ argument
[all …]
/freebsd/usr.bin/lockf/
H A Dlockf.130 .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/contrib/llvm-project/openmp/runtime/src/
H A Dkmp_lock.h2 * 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,
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 Dcl_passivelock.h38 * 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 …]
/freebsd/sys/contrib/ck/include/
H A Dck_elide.h45 * _busy: Lock was busy
138 * L_P - Lock predicate, returns false if resource is available.
145 ck_elide_##N##_lock_adaptive(T *lock, \
161 if (L_P(lock) == true) \
173 if (L_P(lock) == false) \
187 L(lock); \
191 ck_elide_##N##_unlock_adaptive(struct ck_elide_stat *st, T *lock) \
194 if (U_P(lock) == false) { \
199 U(lock); \
205 ck_elide_##N##_lock(T *lock) \
[all …]

12345678910>>...121