Home
last modified time | relevance | path

Searched refs:lock (Results 26 – 50 of 1644) sorted by relevance

12345678910>>...66

/freebsd/contrib/ntp/sntp/libevent/
H A Devthread_win32.c54 if (!lock) in evthread_win32_lock_create()
57 mm_free(lock); in evthread_win32_lock_create()
60 return lock; in evthread_win32_lock_create()
66 CRITICAL_SECTION *lock = lock_; in evthread_win32_lock_free() local
67 DeleteCriticalSection(lock); in evthread_win32_lock_free()
68 mm_free(lock); in evthread_win32_lock_free()
78 EnterCriticalSection(lock); in evthread_win32_lock()
87 LeaveCriticalSection(lock); in evthread_win32_unlock()
183 CRITICAL_SECTION lock; member
249 LeaveCriticalSection(lock); in evthread_win32_cond_wait()
[all …]
H A Devthread_pthread.c49 if (!lock) in evthread_posix_lock_alloc()
54 mm_free(lock); in evthread_posix_lock_alloc()
57 return lock; in evthread_posix_lock_alloc()
63 pthread_mutex_t *lock = lock_; in evthread_posix_lock_free() local
64 pthread_mutex_destroy(lock); in evthread_posix_lock_free()
65 mm_free(lock); in evthread_posix_lock_free()
71 pthread_mutex_t *lock = lock_; in evthread_posix_lock() local
75 return pthread_mutex_lock(lock); in evthread_posix_lock()
81 pthread_mutex_t *lock = lock_; in evthread_posix_unlock() local
82 return pthread_mutex_unlock(lock); in evthread_posix_unlock()
[all …]
/freebsd/contrib/libevent/
H A Devthread_win32.c54 if (!lock) in evthread_win32_lock_create()
57 mm_free(lock); in evthread_win32_lock_create()
60 return lock; in evthread_win32_lock_create()
66 CRITICAL_SECTION *lock = lock_; in evthread_win32_lock_free() local
67 DeleteCriticalSection(lock); in evthread_win32_lock_free()
68 mm_free(lock); in evthread_win32_lock_free()
78 EnterCriticalSection(lock); in evthread_win32_lock()
87 LeaveCriticalSection(lock); in evthread_win32_unlock()
183 CRITICAL_SECTION lock; member
249 LeaveCriticalSection(lock); in evthread_win32_cond_wait()
[all …]
H A Devthread_pthread.c49 if (!lock) in evthread_posix_lock_alloc()
54 mm_free(lock); in evthread_posix_lock_alloc()
57 return lock; in evthread_posix_lock_alloc()
63 pthread_mutex_t *lock = lock_; in evthread_posix_lock_free() local
64 pthread_mutex_destroy(lock); in evthread_posix_lock_free()
65 mm_free(lock); in evthread_posix_lock_free()
71 pthread_mutex_t *lock = lock_; in evthread_posix_lock() local
75 return pthread_mutex_lock(lock); in evthread_posix_lock()
81 pthread_mutex_t *lock = lock_; in evthread_posix_unlock() local
82 return pthread_mutex_unlock(lock); in evthread_posix_unlock()
[all …]
/freebsd/sys/contrib/ck/include/
H A Dck_elide.h187 L(lock); \
199 U(lock); \
209 L(lock); \
225 U(lock); \
239 if (TL_P(lock) == true) \
261 L(lock); \
266 T *lock) \
270 U(lock); \
277 L(lock); \
284 U(lock); \
[all …]
/freebsd/crypto/openssl/crypto/
H A Dthreads_none.c22 CRYPTO_RWLOCK *lock; in CRYPTO_THREAD_lock_new() local
29 *(unsigned int *)lock = 1; in CRYPTO_THREAD_lock_new()
31 return lock; in CRYPTO_THREAD_lock_new()
36 if (!ossl_assert(*(unsigned int *)lock == 1)) in CRYPTO_THREAD_read_lock()
43 if (!ossl_assert(*(unsigned int *)lock == 1)) in CRYPTO_THREAD_write_lock()
48 int CRYPTO_THREAD_unlock(CRYPTO_RWLOCK *lock) in CRYPTO_THREAD_unlock() argument
50 if (!ossl_assert(*(unsigned int *)lock == 1)) in CRYPTO_THREAD_unlock()
56 if (lock == NULL) in CRYPTO_THREAD_lock_free()
59 *(unsigned int *)lock = 0; in CRYPTO_THREAD_lock_free()
60 OPENSSL_free(lock); in CRYPTO_THREAD_lock_free()
[all …]
/freebsd/contrib/unbound/util/storage/
H A Dlruhash.c71 lock_quick_init(&table->lock); in lruhash_create()
205 lock_quick_lock(&bin->lock); in reclaim_space()
209 lock_rw_wrlock(&d->lock); in reclaim_space()
213 lock_rw_unlock(&d->lock); in reclaim_space()
323 lock_quick_lock(&bin->lock); in lruhash_insert()
372 lock_quick_lock(&bin->lock); in lruhash_lookup()
399 lock_quick_lock(&bin->lock); in lruhash_remove()
431 lock_rw_wrlock(&p->lock); in bin_clear()
436 lock_rw_unlock(&p->lock); in bin_clear()
572 lock_quick_lock(&h->lock); in lruhash_traverse()
[all …]
/freebsd/contrib/llvm-project/compiler-rt/lib/sanitizer_common/
H A Dsanitizer_atomic_clang_mips.h23 static void __spin_lock(volatile int *lock) { in __spin_lock() argument
24 while (__sync_lock_test_and_set(lock, 1)) in __spin_lock()
25 while (*lock) { in __spin_lock()
29 static void __spin_unlock(volatile int *lock) { __sync_lock_release(lock); } in __spin_unlock() argument
35 int lock; member
49 __spin_lock(&lock.lock); in atomic_fetch_add()
52 __spin_unlock(&lock.lock); in atomic_fetch_add()
78 __spin_lock(&lock.lock); in atomic_compare_exchange_strong()
84 __spin_unlock(&lock.lock); in atomic_compare_exchange_strong()
109 __spin_lock(&lock.lock); in atomic_store()
[all …]
/freebsd/sys/compat/linuxkpi/common/include/linux/
H A Dww_mutex.h78 ww_mutex_trylock(struct ww_mutex *lock) in ww_mutex_trylock()
81 return (mutex_trylock(&lock->base)); in ww_mutex_trylock()
95 return (linux_ww_mutex_lock_sub(lock, ctx, 0)); in ww_mutex_lock()
106 return (linux_ww_mutex_lock_sub(lock, ctx, 1)); in ww_mutex_lock_interruptible()
112 ww_mutex_unlock(struct ww_mutex *lock) in ww_mutex_unlock() argument
117 linux_ww_mutex_unlock_sub(lock); in ww_mutex_unlock()
121 ww_mutex_destroy(struct ww_mutex *lock) in ww_mutex_destroy() argument
123 cv_destroy(&lock->condvar); in ww_mutex_destroy()
124 mutex_destroy(&lock->base); in ww_mutex_destroy()
133 ww_mutex_init(struct ww_mutex *lock, struct ww_class *ww_class) in ww_mutex_init() argument
[all …]
H A Dspinlock.h35 #include <sys/lock.h>
142 #define spin_lock_init(lock) mtx_init(lock, spin_lock_name("lnxspin"), \
147 #define DEFINE_SPINLOCK(lock) \ in linux_spin_lock_init() argument
148 spinlock_t lock; \ in linux_spin_lock_init()
149 MTX_SYSINIT(lock, &lock, spin_lock_name("lnxspin"), MTX_DEF) in linux_spin_lock_init()
157 #define atomic_dec_and_lock_irqsave(cnt, lock, flags) \ in spin_lock_destroy()
158 _atomic_dec_and_lock_irqsave(cnt, lock, &(flags)) in spin_lock_destroy()
160 _atomic_dec_and_lock_irqsave(atomic_t *cnt, spinlock_t *lock,
144 spin_lock_init(lock) global() argument
155 spin_lock_destroy(spinlock_t * lock) spin_lock_destroy() argument
161 DEFINE_SPINLOCK(lock) global() argument
171 atomic_dec_and_lock_irqsave(cnt,lock,flags) global() argument
174 _atomic_dec_and_lock_irqsave(atomic_t * cnt,spinlock_t * lock,unsigned long * flags) _atomic_dec_and_lock_irqsave() argument
[all...]
/freebsd/sys/contrib/ck/include/spinlock/
H A Ddec.h51 ck_spinlock_dec_init(struct ck_spinlock_dec *lock) in ck_spinlock_dec_init() argument
54 lock->value = 1; in ck_spinlock_dec_init()
64 value = ck_pr_fas_uint(&lock->value, 0); in ck_spinlock_dec_trylock()
70 ck_spinlock_dec_locked(struct ck_spinlock_dec *lock) in ck_spinlock_dec_locked() argument
74 r = ck_pr_load_uint(&lock->value) != 1; in ck_spinlock_dec_locked()
80 ck_spinlock_dec_lock(struct ck_spinlock_dec *lock) in ck_spinlock_dec_lock() argument
90 ck_pr_dec_uint_zero(&lock->value, &r); in ck_spinlock_dec_lock()
95 while (ck_pr_load_uint(&lock->value) != 1) in ck_spinlock_dec_lock()
110 ck_pr_dec_uint_zero(&lock->value, &r); in ck_spinlock_dec_lock_eb()
114 while (ck_pr_load_uint(&lock->value) != 1) in ck_spinlock_dec_lock_eb()
[all …]
H A Dcas.h49 ck_spinlock_cas_init(struct ck_spinlock_cas *lock) in ck_spinlock_cas_init() argument
52 lock->value = false; in ck_spinlock_cas_init()
58 ck_spinlock_cas_trylock(struct ck_spinlock_cas *lock) in ck_spinlock_cas_trylock() argument
62 value = ck_pr_fas_uint(&lock->value, true); in ck_spinlock_cas_trylock()
68 ck_spinlock_cas_locked(struct ck_spinlock_cas *lock) in ck_spinlock_cas_locked() argument
70 bool r = ck_pr_load_uint(&lock->value); in ck_spinlock_cas_locked()
77 ck_spinlock_cas_lock(struct ck_spinlock_cas *lock) in ck_spinlock_cas_lock() argument
81 while (ck_pr_load_uint(&lock->value) == true) in ck_spinlock_cas_lock()
90 ck_spinlock_cas_lock_eb(struct ck_spinlock_cas *lock) in ck_spinlock_cas_lock_eb() argument
102 ck_spinlock_cas_unlock(struct ck_spinlock_cas *lock) in ck_spinlock_cas_unlock() argument
[all …]
H A Dfas.h47 ck_spinlock_fas_init(struct ck_spinlock_fas *lock) in ck_spinlock_fas_init() argument
50 lock->value = false; in ck_spinlock_fas_init()
56 ck_spinlock_fas_trylock(struct ck_spinlock_fas *lock) in ck_spinlock_fas_trylock() argument
60 value = ck_pr_fas_uint(&lock->value, true); in ck_spinlock_fas_trylock()
67 ck_spinlock_fas_locked(struct ck_spinlock_fas *lock) in ck_spinlock_fas_locked() argument
71 r = ck_pr_load_uint(&lock->value); in ck_spinlock_fas_locked()
77 ck_spinlock_fas_lock(struct ck_spinlock_fas *lock) in ck_spinlock_fas_lock() argument
91 ck_spinlock_fas_lock_eb(struct ck_spinlock_fas *lock) in ck_spinlock_fas_lock_eb() argument
95 while (ck_pr_fas_uint(&lock->value, true) == true) in ck_spinlock_fas_lock_eb()
103 ck_spinlock_fas_unlock(struct ck_spinlock_fas *lock) in ck_spinlock_fas_unlock() argument
[all …]
/freebsd/contrib/unbound/services/
H A Dview.c64 lock_rw_init(&v->lock); in views_create()
79 lock_rw_destroy(&v->lock); in view_delete()
98 lock_rw_destroy(&v->lock); in views_delete()
115 lock_rw_init(&v->lock); in view_create()
131 lock_rw_wrlock(&vs->lock); in views_enter_view_name()
132 lock_rw_wrlock(&v->lock); in views_enter_view_name()
135 lock_rw_unlock(&v->lock); in views_enter_view_name()
137 lock_rw_unlock(&vs->lock); in views_enter_view_name()
140 lock_rw_unlock(&vs->lock); in views_enter_view_name()
218 lock_rw_unlock(&v->lock); in views_apply_cfg()
[all …]
/freebsd/sys/compat/linuxkpi/common/src/
H A Dlinux_lock.c35 struct ww_mutex *lock; member
72 linux_ww_mutex_lock_sub(struct ww_mutex *lock, in linux_ww_mutex_lock_sub() argument
85 entry.lock = lock; in linux_ww_mutex_lock_sub()
90 SX_OWNER(lock->base.sx.sx_lock); in linux_ww_mutex_lock_sub()
118 cv_wait(&lock->condvar, &ww_mutex_global); in linux_ww_mutex_lock_sub()
120 } while (sx_try_xlock(&lock->base.sx) == 0); in linux_ww_mutex_lock_sub()
126 cv_signal(&lock->condvar); in linux_ww_mutex_lock_sub()
130 lock->ctx = ctx; in linux_ww_mutex_lock_sub()
140 lock->ctx = NULL; in linux_ww_mutex_unlock_sub()
141 sx_xunlock(&lock->base.sx); in linux_ww_mutex_unlock_sub()
[all …]
/freebsd/contrib/llvm-project/compiler-rt/lib/tsan/rtl/
H A Dtsan_interceptors_mac.cpp194 REAL(OSSpinLockLock)(lock); in TSAN_INTERCEPTOR()
195 Acquire(thr, pc, (uptr)lock); in TSAN_INTERCEPTOR()
216 Release(thr, pc, (uptr)lock); in TSAN_INTERCEPTOR()
217 REAL(OSSpinLockUnlock)(lock); in TSAN_INTERCEPTOR()
226 REAL(os_lock_lock)(lock); in TSAN_INTERCEPTOR()
227 Acquire(thr, pc, (uptr)lock); in TSAN_INTERCEPTOR()
248 Release(thr, pc, (uptr)lock); in TSAN_INTERCEPTOR()
249 REAL(os_lock_unlock)(lock); in TSAN_INTERCEPTOR()
258 Acquire(thr, pc, (uptr)lock); in TSAN_INTERCEPTOR()
268 Acquire(thr, pc, (uptr)lock); in TSAN_INTERCEPTOR()
[all …]
/freebsd/libexec/rtld-elf/
H A Drtld_lock.c80 volatile u_int lock; member
114 l->lock = 0; in def_lock_create()
119 def_lock_destroy(void *lock) in def_lock_destroy() argument
121 Lock *l = lock; in def_lock_destroy()
177 def_rlock_acquire(void *lock) in def_rlock_acquire() argument
183 def_wlock_acquire(void *lock) in def_wlock_acquire() argument
189 def_lock_release(void *lock) in def_lock_release() argument
191 Lock *l = lock; in def_lock_release()
193 atomic_add_rel_int(&l->lock, -((l->lock & WAFLAG) == 0 ? in def_lock_release()
254 if (thread_mask_set(lock->mask) & lock->mask) { in rlock_acquire()
[all …]
/freebsd/sys/contrib/openzfs/include/os/freebsd/spl/sys/
H A Dspl_condvar.h56 void _cv_wait(struct cv *cvp, struct lock_object *lock);
57 void _cv_wait_unlock(struct cv *cvp, struct lock_object *lock);
58 int _cv_wait_sig(struct cv *cvp, struct lock_object *lock);
59 int _cv_timedwait_sbt(struct cv *cvp, struct lock_object *lock,
61 int _cv_timedwait_sig_sbt(struct cv *cvp, struct lock_object *lock,
67 #define cv_wait(cvp, lock) \ argument
68 _cv_wait((cvp), &(lock)->lock_object)
69 #define cv_wait_unlock(cvp, lock) \ argument
70 _cv_wait_unlock((cvp), &(lock)->lock_object)
71 #define cv_timedwait_sbt(cvp, lock, sbt, pr, flags) \ argument
[all …]
/freebsd/sys/dev/ocs_fc/
H A Docs_os.h556 if (mtx_initialized(&(lock)->lock)) { in ocs_lock_free()
558 mtx_destroy(&(lock)->lock); in ocs_lock_free()
574 if (mtx_initialized(&(lock)->lock)) { in ocs_lock()
576 mtx_lock(&(lock)->lock); in ocs_lock()
592 if (mtx_initialized(&(lock)->lock)) { in ocs_unlock()
594 mtx_unlock(&(lock)->lock); in ocs_unlock()
631 if (mtx_initialized(&(lock)->lock)) { in ocs_rlock_free()
632 mtx_destroy(&(lock)->lock); in ocs_rlock_free()
650 int rc = mtx_trylock(&(lock)->lock); in ocs_rlock_try()
665 mtx_lock(&(lock)->lock); in ocs_rlock_acquire()
[all …]
/freebsd/sys/dev/drm2/
H A Ddrm_gem_names.c60 mtx_lock(&names->lock); in drm_gem_names_fini()
64 mtx_lock(&names->lock); in drm_gem_names_fini()
67 mtx_unlock(&names->lock); in drm_gem_names_fini()
68 mtx_destroy(&names->lock); in drm_gem_names_fini()
86 mtx_lock(&names->lock); in drm_gem_name_ref()
95 mtx_unlock(&names->lock); in drm_gem_name_ref()
134 mtx_lock(&names->lock); in drm_gem_find_ptr()
142 mtx_unlock(&names->lock); in drm_gem_find_ptr()
156 mtx_lock(&names->lock); in drm_gem_name_create()
187 mtx_lock(&names->lock); in drm_gem_names_remove()
[all …]
/freebsd/lib/libthr/thread/
H A Dthr_rtld.c54 struct urwlock lock; member
84 _thr_rtld_lock_destroy(void *lock) in _thr_rtld_lock_destroy() argument
91 ((char *)lock)[i] = 0; in _thr_rtld_lock_destroy()
110 _thr_rtld_rlock_acquire(void *lock) in _thr_rtld_rlock_acquire() argument
118 l = (struct rtld_lock *)lock; in _thr_rtld_rlock_acquire()
136 l = (struct rtld_lock *)lock; in _thr_rtld_wlock_acquire()
145 _thr_rtld_lock_release(void *lock) in _thr_rtld_lock_release() argument
154 l = (struct rtld_lock *)lock; in _thr_rtld_lock_release()
156 state = l->lock.rw_state; in _thr_rtld_lock_release()
165 l->lock.rw_blocked_readers = 0; in _thr_rtld_lock_release()
[all …]
/freebsd/contrib/ofed/opensm/complib/
H A Dcl_dispatcher.c80 cl_spinlock_acquire(&p_disp->lock); in __cl_disp_worker()
97 cl_spinlock_release(&p_disp->lock); in __cl_disp_worker()
112 cl_spinlock_acquire(&p_disp->lock); in __cl_disp_worker()
118 cl_spinlock_release(&p_disp->lock); in __cl_disp_worker()
151 cl_spinlock_destroy(&p_disp->lock); in cl_disp_destroy()
210 cl_spinlock_acquire(&p_disp->lock); in cl_disp_register()
247 cl_spinlock_release(&p_disp->lock); in cl_disp_register()
264 cl_spinlock_acquire(&p_disp->lock); in cl_disp_unregister()
274 cl_spinlock_release(&p_disp->lock); in cl_disp_unregister()
279 cl_spinlock_acquire(&p_disp->lock); in cl_disp_unregister()
[all …]
/freebsd/crypto/openssl/include/internal/
H A Drefcount.h31 ossl_unused void *lock) in CRYPTO_UP_REF() argument
48 ossl_unused void *lock) in CRYPTO_DOWN_REF() argument
69 ossl_unused void *lock) in CRYPTO_DOWN_REF() argument
81 ossl_unused void *lock) in CRYPTO_UP_REF() argument
88 ossl_unused void *lock) in CRYPTO_DOWN_REF() argument
107 ossl_unused void *lock) in CRYPTO_UP_REF() argument
114 ossl_unused void *lock) in CRYPTO_DOWN_REF() argument
135 ossl_unused void *lock) in CRYPTO_UP_REF() argument
142 ossl_unused void *lock) in CRYPTO_DOWN_REF() argument
161 # define CRYPTO_UP_REF(val, ret, lock) CRYPTO_atomic_add(val, 1, ret, lock) argument
[all …]
/freebsd/contrib/ofed/librdmacm/
H A Dcma.h57 static inline void fastlock_init(fastlock_t *lock) in fastlock_init() argument
59 sem_init(&lock->sem, 0, 0); in fastlock_init()
60 atomic_store(&lock->cnt, 0); in fastlock_init()
62 static inline void fastlock_destroy(fastlock_t *lock) in fastlock_destroy() argument
64 sem_destroy(&lock->sem); in fastlock_destroy()
66 static inline void fastlock_acquire(fastlock_t *lock) in fastlock_acquire() argument
68 if (atomic_fetch_add(&lock->cnt, 1) > 0) in fastlock_acquire()
69 sem_wait(&lock->sem); in fastlock_acquire()
71 static inline void fastlock_release(fastlock_t *lock) in fastlock_release() argument
73 if (atomic_fetch_sub(&lock->cnt, 1) > 1) in fastlock_release()
[all …]
/freebsd/contrib/ntp/libntp/lib/isc/
H A Dtask.c107 isc_mutex_t lock; member
139 isc_mutex_t lock; member
519 LOCK(&task->lock); in isc__task_detach()
577 LOCK(&task->lock); in isc__task_send()
617 LOCK(&task->lock); in isc__task_sendanddetach()
658 LOCK(&task->lock); in dequeue_events()
745 LOCK(&task->lock); in isc__task_purgeevent()
820 LOCK(&task->lock); in isc__task_onshutdown()
845 LOCK(&task->lock); in isc__task_shutdown()
876 LOCK(&task->lock); in isc__task_setname()
[all …]

12345678910>>...66