Searched refs:lock (Results 1 - 25 of 2982) sorted by relevance

1234567891011>>

/freebsd-current/lib/libc/iconv/
H A Dcitrus_lock.h31 #define WLOCK(lock) if (__isthreaded) \
32 pthread_rwlock_wrlock(lock);
33 #define UNLOCK(lock) if (__isthreaded) \
34 pthread_rwlock_unlock(lock);
/freebsd-current/sys/dev/drm2/ttm/
H A Dttm_lock.c48 void ttm_lock_init(struct ttm_lock *lock) argument
50 mtx_init(&lock->lock, "ttmlk", NULL, MTX_DEF);
51 lock->rw = 0;
52 lock->flags = 0;
53 lock->kill_takers = false;
54 lock->signal = SIGKILL;
68 void ttm_read_unlock(struct ttm_lock *lock) argument
70 mtx_lock(&lock->lock);
76 __ttm_read_lock(struct ttm_lock *lock) argument
92 ttm_read_lock(struct ttm_lock *lock, bool interruptible) argument
116 __ttm_read_trylock(struct ttm_lock *lock, bool *locked) argument
137 ttm_read_trylock(struct ttm_lock *lock, bool interruptible) argument
165 ttm_write_unlock(struct ttm_lock *lock) argument
173 __ttm_write_lock(struct ttm_lock *lock) argument
192 ttm_write_lock(struct ttm_lock *lock, bool interruptible) argument
222 ttm_write_lock_downgrade(struct ttm_lock *lock) argument
230 __ttm_vt_unlock(struct ttm_lock *lock) argument
247 struct ttm_lock *lock = container_of(base, struct ttm_lock, base); local
255 __ttm_vt_lock(struct ttm_lock *lock) argument
269 ttm_vt_lock(struct ttm_lock *lock, bool interruptible, struct ttm_object_file *tfile) argument
312 ttm_vt_unlock(struct ttm_lock *lock) argument
318 ttm_suspend_unlock(struct ttm_lock *lock) argument
326 __ttm_suspend_lock(struct ttm_lock *lock) argument
340 ttm_suspend_lock(struct ttm_lock *lock) argument
[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 i
71 struct mtx lock; member in struct:ttm_lock
219 ttm_lock_set_kill(struct ttm_lock *lock, bool val, int signal) argument
[all...]
/freebsd-current/sys/compat/linuxkpi/common/include/linux/
H A Drwlock.h33 #include <sys/lock.h>
43 #define read_lock_irq(lock) read_lock((lock))
44 #define read_unlock_irq(lock) read_unlock((lock))
45 #define write_lock_irq(lock) write_lock((lock))
46 #define write_unlock_irq(lock) write_unlock((lock))
47 #define read_lock_irqsave(lock, flag
[all...]
/freebsd-current/sys/cddl/compat/opensolaris/sys/
H A Drwlock.h32 #include <sys/lock.h>
59 #define rw_init(lock, desc, type, arg) do { \
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_destro
[all...]
/freebsd-current/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 { \
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)
72 #define rw_enter(lock, how) do { \
74 sx_slock(lock); \
76 sx_xlock(lock); \
[all...]
H A Dmutex.h35 #include <sys/lock.h>
54 #define mutex_init(lock, desc, type, arg) do { \
57 for (_name = #lock; *_name != '\0'; _name++) { \
62 _name = #lock; \
63 sx_init_flags((lock), _name, MUTEX_FLAGS); \
65 #define mutex_destroy(lock) sx_destroy(lock)
66 #define mutex_enter(lock) sx_xlock(lock)
67 #define mutex_enter_interruptible(lock) sx_xlock_si
[all...]
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) \
68 _cv_wait((cvp), &(lock)->lock_object)
69 #define cv_wait_unlock(cvp, lock) \
70 _cv_wait_unlock((cvp), &(lock)->lock_object)
71 #define cv_timedwait_sbt(cvp, lock, sb
[all...]
/freebsd-current/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 */
87 #define lock_unprotect(lock, area) /* nop */
88 #define lock_get_mem(lock) (0) /* nothing */
97 /** use pthread mutex for basic lock */
100 #define lock_basic_init(lock) LOCKRET(pthread_mutex_init(lock, NULL))
101 #define lock_basic_destroy(lock) LOCKRE
[all...]
/freebsd-current/crypto/heimdal/lib/hx509/
H A Dlock.c60 hx509_lock_init(hx509_context context, hx509_lock *lock) argument
65 *lock = NULL;
81 *lock = l;
87 hx509_lock_add_password(hx509_lock lock, const char *password) argument
96 d = realloc(lock->password.val,
97 (lock->password.len + 1) * sizeof(lock->password.val[0]));
102 lock->password.val = d;
103 lock->password.val[lock
110 _hx509_lock_get_passwords(hx509_lock lock) argument
116 _hx509_lock_unlock_certs(hx509_lock lock) argument
122 hx509_lock_reset_passwords(hx509_lock lock) argument
133 hx509_lock_add_cert(hx509_context context, hx509_lock lock, hx509_cert cert) argument
139 hx509_lock_add_certs(hx509_context context, hx509_lock lock, hx509_certs certs) argument
145 hx509_lock_reset_certs(hx509_context context, hx509_lock lock) argument
162 _hx509_lock_find_cert(hx509_lock lock, const hx509_query *q, hx509_cert *c) argument
169 hx509_lock_set_prompter(hx509_lock lock, hx509_prompter_fct prompt, void *data) argument
177 hx509_lock_reset_promper(hx509_lock lock) argument
207 hx509_lock_prompt(hx509_lock lock, hx509_prompt *prompt) argument
215 hx509_lock_free(hx509_lock lock) argument
240 hx509_lock_command_string(hx509_lock lock, const char *string) argument
[all...]
/freebsd-current/contrib/ntp/sntp/libevent/
H A Devthread.c107 event_warnx("Trying to disable lock functions after "
118 target->lock == cbs->lock &&
123 event_warnx("Can't change lock callbacks once they have been "
127 if (cbs->alloc && cbs->free && cbs->lock && cbs->unlock) {
189 * lock to protect count. */
191 void *lock; member in struct:debug_lock
201 if (!(result->lock = original_lock_fns_.alloc(
207 result->lock = NULL;
219 struct debug_lock *lock local
234 evthread_debug_lock_mark_locked(unsigned mode, struct debug_lock *lock) argument
252 struct debug_lock *lock = lock_; local
267 evthread_debug_lock_mark_unlocked(unsigned mode, struct debug_lock *lock) argument
288 struct debug_lock *lock = lock_; local
300 struct debug_lock *lock = lock_; local
347 struct debug_lock *lock = lock_; local
361 struct debug_lock *lock = lock_; local
380 struct debug_lock *lock; local
404 struct debug_lock *lock = lock_ ? lock_ : debug_lock_alloc(locktype); local
441 evthreadimpl_lock_free_(void *lock, unsigned locktype) argument
447 evthreadimpl_lock_lock_(unsigned mode, void *lock) argument
455 evthreadimpl_lock_unlock_(unsigned mode, void *lock) argument
489 evthreadimpl_cond_wait_(void *cond, void *lock, const struct timeval *tv) argument
[all...]
/freebsd-current/contrib/libevent/
H A Devthread.c107 event_warnx("Trying to disable lock functions after "
118 target->lock == cbs->lock &&
123 event_warnx("Can't change lock callbacks once they have been "
127 if (cbs->alloc && cbs->free && cbs->lock && cbs->unlock) {
189 * lock to protect count. */
191 void *lock; member in struct:debug_lock
201 if (!(result->lock = original_lock_fns_.alloc(
207 result->lock = NULL;
219 struct debug_lock *lock local
234 evthread_debug_lock_mark_locked(unsigned mode, struct debug_lock *lock) argument
252 struct debug_lock *lock = lock_; local
267 evthread_debug_lock_mark_unlocked(unsigned mode, struct debug_lock *lock) argument
288 struct debug_lock *lock = lock_; local
300 struct debug_lock *lock = lock_; local
347 struct debug_lock *lock = lock_; local
361 struct debug_lock *lock = lock_; local
380 struct debug_lock *lock; local
404 struct debug_lock *lock = lock_ ? lock_ : debug_lock_alloc(locktype); local
441 evthreadimpl_lock_free_(void *lock, unsigned locktype) argument
447 evthreadimpl_lock_lock_(unsigned mode, void *lock) argument
455 evthreadimpl_lock_unlock_(unsigned mode, void *lock) argument
489 evthreadimpl_cond_wait_(void *cond, void *lock, const struct timeval *tv) argument
[all...]
/freebsd-current/crypto/openssl/crypto/
H A Dthreads_win.c35 SRWLOCK lock; member in struct:__anon55
42 CRYPTO_RWLOCK *lock; local
46 if ((lock = OPENSSL_zalloc(sizeof(CRYPTO_win_rwlock))) == NULL)
48 rwlock = lock;
49 InitializeSRWLock(&rwlock->lock);
52 if ((lock = OPENSSL_zalloc(sizeof(CRITICAL_SECTION))) == NULL) {
59 if (!InitializeCriticalSectionAndSpinCount(lock, 0x400)) {
60 OPENSSL_free(lock);
64 InitializeCriticalSection(lock);
68 return lock;
71 CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *lock) argument
83 CRYPTO_THREAD_write_lock(CRYPTO_RWLOCK *lock) argument
96 CRYPTO_THREAD_unlock(CRYPTO_RWLOCK *lock) argument
113 CRYPTO_THREAD_lock_free(CRYPTO_RWLOCK *lock) argument
136 LONG volatile *lock = (LONG *)once; local
213 CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock) argument
219 CRYPTO_atomic_or(uint64_t *val, uint64_t op, uint64_t *ret, CRYPTO_RWLOCK *lock) argument
238 CRYPTO_atomic_load(uint64_t *val, uint64_t *ret, CRYPTO_RWLOCK *lock) argument
[all...]
H A Dthreads_pthread.c48 CRYPTO_RWLOCK *lock; local
50 if ((lock = OPENSSL_zalloc(sizeof(pthread_rwlock_t))) == NULL) {
55 if (pthread_rwlock_init(lock, NULL) != 0) {
56 OPENSSL_free(lock);
61 CRYPTO_RWLOCK *lock;
63 if ((lock = OPENSSL_zalloc(sizeof(pthread_mutex_t))) == NULL) {
80 if (pthread_mutex_init(lock, &attr) != 0) {
82 OPENSSL_free(lock);
89 return lock;
92 __owur int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *lock) argument
107 CRYPTO_THREAD_write_lock(CRYPTO_RWLOCK *lock) argument
122 CRYPTO_THREAD_unlock(CRYPTO_RWLOCK *lock) argument
137 CRYPTO_THREAD_lock_free(CRYPTO_RWLOCK *lock) argument
199 CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock) argument
225 CRYPTO_atomic_or(uint64_t *val, uint64_t op, uint64_t *ret, CRYPTO_RWLOCK *lock) argument
251 CRYPTO_atomic_load(uint64_t *val, uint64_t *ret, CRYPTO_RWLOCK *lock) argument
[all...]
H A Dthreads_none.c22 CRYPTO_RWLOCK *lock; local
24 if ((lock = OPENSSL_zalloc(sizeof(unsigned int))) == NULL) {
29 *(unsigned int *)lock = 1;
31 return lock;
34 __owur int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *lock) argument
36 if (!ossl_assert(*(unsigned int *)lock == 1))
41 __owur int CRYPTO_THREAD_write_lock(CRYPTO_RWLOCK *lock) argument
43 if (!ossl_assert(*(unsigned int *)lock == 1))
48 int CRYPTO_THREAD_unlock(CRYPTO_RWLOCK *lock) argument
50 if (!ossl_assert(*(unsigned int *)lock
55 CRYPTO_THREAD_lock_free(CRYPTO_RWLOCK *lock) argument
128 CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock) argument
136 CRYPTO_atomic_or(uint64_t *val, uint64_t op, uint64_t *ret, CRYPTO_RWLOCK *lock) argument
145 CRYPTO_atomic_load(uint64_t *val, uint64_t *ret, CRYPTO_RWLOCK *lock) argument
[all...]
/freebsd-current/sys/contrib/openzfs/include/os/freebsd/zfs/sys/
H A Dfreebsd_event.h33 void knlist_init_sx(struct knlist *knl, struct sx *lock);
/freebsd-current/lib/libthr/thread/
H A Dthr_pspinlock.c53 _pthread_spin_init(pthread_spinlock_t *lock, int pshared) argument
57 if (lock == NULL)
64 *lock = lck;
66 lck = __thr_pshared_offpage(lock, 1);
69 *lock = THR_PSHARED_PTR;
78 _pthread_spin_destroy(pthread_spinlock_t *lock) argument
83 if (lock == NULL || *lock == NULL) {
85 } else if (*lock == THR_PSHARED_PTR) {
86 l = __thr_pshared_offpage(lock,
99 _pthread_spin_trylock(pthread_spinlock_t *lock) argument
112 _pthread_spin_lock(pthread_spinlock_t *lock) argument
143 _pthread_spin_unlock(pthread_spinlock_t *lock) argument
[all...]
/freebsd-current/sys/contrib/openzfs/cmd/zed/
H A Dzed_file.c27 * Set an exclusive advisory lock on the open file descriptor [fd].
28 * Return 0 on success, 1 if a conflicting lock is held by another process,
34 struct flock lock; local
40 lock.l_type = F_WRLCK;
41 lock.l_whence = SEEK_SET;
42 lock.l_start = 0;
43 lock.l_len = 0;
45 if (fcntl(fd, F_SETLK, &lock) < 0) {
55 * Release an advisory lock held on the open file descriptor [fd].
61 struct flock lock; local
87 struct flock lock; local
[all...]
/freebsd-current/sbin/hastd/
H A Dsynch.h49 mtx_init(pthread_mutex_t *lock) __requires_unlocked(*lock)
53 error = pthread_mutex_init(lock, NULL);
57 mtx_destroy(pthread_mutex_t *lock) __requires_unlocked(*lock)
61 error = pthread_mutex_destroy(lock);
65 mtx_lock(pthread_mutex_t *lock) __locks_exclusive(*lock)
69 error = pthread_mutex_lock(lock);
73 mtx_trylock(pthread_mutex_t *lock) __trylocks_exclusiv
90 mtx_owned(pthread_mutex_t *lock) argument
[all...]
/freebsd-current/sys/contrib/ck/include/spinlock/
H A Danderson.h39 * This is an implementation of Anderson's array-based queuing lock.
58 ck_spinlock_anderson_init(struct ck_spinlock_anderson *lock, argument
71 lock->slots = slots;
72 lock->count = count;
73 lock->mask = count - 1;
74 lock->next = 0;
82 lock->wrap = (UINT_MAX % count) + 1;
84 lock->wrap = 0;
91 ck_spinlock_anderson_locked(struct ck_spinlock_anderson *lock) argument
96 position = ck_pr_load_uint(&lock
103 ck_spinlock_anderson_lock(struct ck_spinlock_anderson *lock, struct ck_spinlock_anderson_thread **slot) argument
150 ck_spinlock_anderson_unlock(struct ck_spinlock_anderson *lock, struct ck_spinlock_anderson_thread *slot) argument
[all...]
H A Ddec.h39 * This is similar to the CACAS lock but makes use of an atomic decrement
40 * operation to check if the lock value was decremented to 0 from 1. The
51 ck_spinlock_dec_init(struct ck_spinlock_dec *lock) argument
54 lock->value = 1;
60 ck_spinlock_dec_trylock(struct ck_spinlock_dec *lock) argument
64 value = ck_pr_fas_uint(&lock->value, 0);
70 ck_spinlock_dec_locked(struct ck_spinlock_dec *lock) argument
74 r = ck_pr_load_uint(&lock->value) != 1;
80 ck_spinlock_dec_lock(struct ck_spinlock_dec *lock) argument
86 * Only one thread is guaranteed to decrement lock t
104 ck_spinlock_dec_lock_eb(struct ck_spinlock_dec *lock) argument
123 ck_spinlock_dec_unlock(struct ck_spinlock_dec *lock) argument
[all...]
H A Dcas.h49 ck_spinlock_cas_init(struct ck_spinlock_cas *lock) argument
52 lock->value = false;
58 ck_spinlock_cas_trylock(struct ck_spinlock_cas *lock) argument
62 value = ck_pr_fas_uint(&lock->value, true);
68 ck_spinlock_cas_locked(struct ck_spinlock_cas *lock) argument
70 bool r = ck_pr_load_uint(&lock->value);
77 ck_spinlock_cas_lock(struct ck_spinlock_cas *lock) argument
80 while (ck_pr_cas_uint(&lock->value, false, true) == false) {
81 while (ck_pr_load_uint(&lock->value) == true)
90 ck_spinlock_cas_lock_eb(struct ck_spinlock_cas *lock) argument
102 ck_spinlock_cas_unlock(struct ck_spinlock_cas *lock) argument
[all...]
H A Dfas.h47 ck_spinlock_fas_init(struct ck_spinlock_fas *lock) argument
50 lock->value = false;
56 ck_spinlock_fas_trylock(struct ck_spinlock_fas *lock) argument
60 value = ck_pr_fas_uint(&lock->value, true);
67 ck_spinlock_fas_locked(struct ck_spinlock_fas *lock) argument
71 r = ck_pr_load_uint(&lock->value);
77 ck_spinlock_fas_lock(struct ck_spinlock_fas *lock) argument
80 while (CK_CC_UNLIKELY(ck_pr_fas_uint(&lock->value, true) == true)) {
83 } while (ck_pr_load_uint(&lock->value) == true);
91 ck_spinlock_fas_lock_eb(struct ck_spinlock_fas *lock) argument
103 ck_spinlock_fas_unlock(struct ck_spinlock_fas *lock) argument
[all...]
/freebsd-current/sys/dev/drm2/
H A Ddrm_lock.c54 * Add the current task to the lock wait queue, and attempt to take to lock.
58 struct drm_lock *lock = data; local
64 if (lock->context == DRM_KERNEL_CONTEXT) {
66 DRM_CURRENTPID, lock->context);
70 DRM_DEBUG("%d (pid %d) requests lock (0x%08x), flags = 0x%08x\n",
71 lock->context, DRM_CURRENTPID,
72 master->lock.hw_lock->lock, lock
152 struct drm_lock *lock = data; local
187 volatile unsigned int *lock = &lock_data->hw_lock->lock; local
236 volatile unsigned int *lock = &lock_data->hw_lock->lock; local
261 volatile unsigned int *lock = &lock_data->hw_lock->lock; local
355 volatile unsigned int *lock = &lock_data->hw_lock->lock; local
[all...]
/freebsd-current/sys/sys/
H A Dcondvar.h51 void _cv_wait(struct cv *cvp, struct lock_object *lock);
52 void _cv_wait_unlock(struct cv *cvp, struct lock_object *lock);
53 int _cv_wait_sig(struct cv *cvp, struct lock_object *lock);
54 int _cv_timedwait_sbt(struct cv *cvp, struct lock_object *lock,
56 int _cv_timedwait_sig_sbt(struct cv *cvp, struct lock_object *lock,
62 #define cv_wait(cvp, lock) \
63 _cv_wait((cvp), &(lock)->lock_object)
64 #define cv_wait_unlock(cvp, lock) \
65 _cv_wait_unlock((cvp), &(lock)->lock_object)
66 #define cv_wait_sig(cvp, lock) \
[all...]

Completed in 285 milliseconds

1234567891011>>