Home
last modified time | relevance | path

Searched refs:lock (Results 1 – 25 of 2364) sorted by relevance

12345678910>>...95

/netbsd-src/external/gpl3/gdb/dist/gnulib/import/glthread/
H A Dlock.c31 glthread_lock_init (gl_lock_t *lock) in glthread_lock_init() argument
33 if (mtx_init (&lock->mutex, mtx_plain) != thrd_success) in glthread_lock_init()
35 lock->init_needed = 0; in glthread_lock_init()
40 glthread_lock_lock (gl_lock_t *lock) in glthread_lock_lock() argument
42 if (lock->init_needed) in glthread_lock_lock()
43 call_once (&lock->init_once, lock->init_func); in glthread_lock_lock()
44 if (mtx_lock (&lock->mutex) != thrd_success) in glthread_lock_lock()
50 glthread_lock_unlock (gl_lock_t *lock) in glthread_lock_unlock() argument
52 if (lock->init_needed) in glthread_lock_unlock()
53 call_once (&lock->init_once, lock->init_func); in glthread_lock_unlock()
[all …]
/netbsd-src/external/gpl2/gettext/dist/gettext-tools/gnulib-lib/
H A Dlock.c78 glthread_rwlock_init (gl_rwlock_t *lock) in glthread_rwlock_init() argument
80 if (pthread_rwlock_init (&lock->rwlock, NULL) != 0) in glthread_rwlock_init()
82 lock->initialized = 1; in glthread_rwlock_init()
86 glthread_rwlock_rdlock (gl_rwlock_t *lock) in glthread_rwlock_rdlock() argument
88 if (!lock->initialized) in glthread_rwlock_rdlock()
90 if (pthread_mutex_lock (&lock->guard) != 0) in glthread_rwlock_rdlock()
92 if (!lock->initialized) in glthread_rwlock_rdlock()
93 glthread_rwlock_init (lock); in glthread_rwlock_rdlock()
94 if (pthread_mutex_unlock (&lock->guard) != 0) in glthread_rwlock_rdlock()
97 if (pthread_rwlock_rdlock (&lock->rwlock) != 0) in glthread_rwlock_rdlock()
[all …]
/netbsd-src/external/gpl2/gettext/dist/gettext-runtime/intl/
H A Dlock.c79 glthread_rwlock_init (gl_rwlock_t *lock) in glthread_rwlock_init() argument
81 if (pthread_rwlock_init (&lock->rwlock, NULL) != 0) in glthread_rwlock_init()
83 lock->initialized = 1; in glthread_rwlock_init()
87 glthread_rwlock_rdlock (gl_rwlock_t *lock) in glthread_rwlock_rdlock() argument
89 if (!lock->initialized) in glthread_rwlock_rdlock()
91 if (pthread_mutex_lock (&lock->guard) != 0) in glthread_rwlock_rdlock()
93 if (!lock->initialized) in glthread_rwlock_rdlock()
94 glthread_rwlock_init (lock); in glthread_rwlock_rdlock()
95 if (pthread_mutex_unlock (&lock->guard) != 0) in glthread_rwlock_rdlock()
98 if (pthread_rwlock_rdlock (&lock->rwlock) != 0) in glthread_rwlock_rdlock()
[all …]
/netbsd-src/external/gpl2/gettext/dist/gettext-tools/libgettextpo/
H A Dlock.c78 glthread_rwlock_init (gl_rwlock_t *lock) in glthread_rwlock_init() argument
80 if (pthread_rwlock_init (&lock->rwlock, NULL) != 0) in glthread_rwlock_init()
82 lock->initialized = 1; in glthread_rwlock_init()
86 glthread_rwlock_rdlock (gl_rwlock_t *lock) in glthread_rwlock_rdlock() argument
88 if (!lock->initialized) in glthread_rwlock_rdlock()
90 if (pthread_mutex_lock (&lock->guard) != 0) in glthread_rwlock_rdlock()
92 if (!lock->initialized) in glthread_rwlock_rdlock()
93 glthread_rwlock_init (lock); in glthread_rwlock_rdlock()
94 if (pthread_mutex_unlock (&lock->guard) != 0) in glthread_rwlock_rdlock()
97 if (pthread_rwlock_rdlock (&lock->rwlock) != 0) in glthread_rwlock_rdlock()
[all …]
/netbsd-src/sys/external/bsd/drm2/dist/drm/vmwgfx/
H A Dttm_lock.c50 void ttm_lock_init(struct ttm_lock *lock) in ttm_lock_init() argument
52 spin_lock_init(&lock->lock); in ttm_lock_init()
53 DRM_INIT_WAITQUEUE(&lock->queue, "ttmlock"); in ttm_lock_init()
54 lock->rw = 0; in ttm_lock_init()
55 lock->flags = 0; in ttm_lock_init()
58 void ttm_read_unlock(struct ttm_lock *lock) in ttm_read_unlock() argument
60 spin_lock(&lock->lock); in ttm_read_unlock()
61 if (--lock->rw == 0) in ttm_read_unlock()
62 DRM_SPIN_WAKEUP_ALL(&lock->queue, &lock->lock); in ttm_read_unlock()
63 spin_unlock(&lock->lock); in ttm_read_unlock()
[all …]
/netbsd-src/external/gpl3/gcc.old/dist/libgomp/config/posix/
H A Dlock.c42 gomp_init_lock_30 (omp_lock_t *lock) in gomp_init_lock_30() argument
44 pthread_mutex_init (lock, NULL); in gomp_init_lock_30()
48 gomp_destroy_lock_30 (omp_lock_t *lock) in gomp_destroy_lock_30() argument
50 pthread_mutex_destroy (lock); in gomp_destroy_lock_30()
54 gomp_set_lock_30 (omp_lock_t *lock) in gomp_set_lock_30() argument
56 pthread_mutex_lock (lock); in gomp_set_lock_30()
60 gomp_unset_lock_30 (omp_lock_t *lock) in gomp_unset_lock_30() argument
62 pthread_mutex_unlock (lock); in gomp_unset_lock_30()
66 gomp_test_lock_30 (omp_lock_t *lock) in gomp_test_lock_30() argument
68 return pthread_mutex_trylock (lock) == 0; in gomp_test_lock_30()
[all …]
/netbsd-src/external/gpl3/gcc/dist/libgomp/config/posix/
H A Dlock.c42 gomp_init_lock_30 (omp_lock_t *lock) in gomp_init_lock_30() argument
44 pthread_mutex_init (lock, NULL); in gomp_init_lock_30()
48 gomp_destroy_lock_30 (omp_lock_t *lock) in gomp_destroy_lock_30() argument
50 pthread_mutex_destroy (lock); in gomp_destroy_lock_30()
54 gomp_set_lock_30 (omp_lock_t *lock) in gomp_set_lock_30() argument
56 pthread_mutex_lock (lock); in gomp_set_lock_30()
60 gomp_unset_lock_30 (omp_lock_t *lock) in gomp_unset_lock_30() argument
62 pthread_mutex_unlock (lock); in gomp_unset_lock_30()
66 gomp_test_lock_30 (omp_lock_t *lock) in gomp_test_lock_30() argument
68 return pthread_mutex_trylock (lock) == 0; in gomp_test_lock_30()
[all …]
/netbsd-src/external/gpl3/gdb/dist/gnulib/import/
H A Dwindows-rwlock.c124 glwthread_rwlock_init (glwthread_rwlock_t *lock) in glwthread_rwlock_init() argument
126 InitializeCriticalSection (&lock->lock); in glwthread_rwlock_init()
127 glwthread_waitqueue_init (&lock->waiting_readers); in glwthread_rwlock_init()
128 glwthread_waitqueue_init (&lock->waiting_writers); in glwthread_rwlock_init()
129 lock->runcount = 0; in glwthread_rwlock_init()
130 lock->guard.done = 1; in glwthread_rwlock_init()
134 glwthread_rwlock_rdlock (glwthread_rwlock_t *lock) in glwthread_rwlock_rdlock() argument
136 if (!lock->guard.done) in glwthread_rwlock_rdlock()
138 if (InterlockedIncrement (&lock->guard.started) == 0) in glwthread_rwlock_rdlock()
140 glwthread_rwlock_init (lock); in glwthread_rwlock_rdlock()
[all …]
/netbsd-src/external/bsd/unbound/dist/util/
H A Dlocks.h86 #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
100 #define lock_basic_init(lock) LOCKRET(pthread_mutex_init(lock, NULL)) argument
101 #define lock_basic_destroy(lock) LOCKRET(pthread_mutex_destroy(lock)) argument
102 #define lock_basic_lock(lock) LOCKRET(pthread_mutex_lock(lock)) argument
103 #define lock_basic_unlock(lock) LOCKRET(pthread_mutex_unlock(lock)) argument
108 #define lock_rw_init(lock) LOCKRET(pthread_mutex_init(lock, NULL)) argument
109 #define lock_rw_destroy(lock) LOCKRET(pthread_mutex_destroy(lock)) argument
110 #define lock_rw_rdlock(lock) LOCKRET(pthread_mutex_lock(lock)) argument
[all …]
/netbsd-src/external/bsd/unbound/dist/testcode/
H A Dchecklocks.c75 static void lock_error(struct checked_lock* lock, const char* func,
79 static void lock_error(struct checked_lock* lock, in lock_error() argument
83 log_err("Created at %s %s:%d", lock->create_func, in lock_error()
84 lock->create_file, lock->create_line); in lock_error()
85 if(lock->holder_func && lock->holder_file) in lock_error()
86 log_err("Previously %s %s:%d", lock->holder_func, in lock_error()
87 lock->holder_file, lock->holder_line); in lock_error()
90 (lock->type==check_lock_mutex)?"mutex": ( in lock_error()
91 (lock->type==check_lock_spinlock)?"spinlock": ( in lock_error()
92 (lock->type==check_lock_rwlock)?"rwlock": "badtype")), err); in lock_error()
[all …]
H A Dchecklocks.h126 pthread_mutex_t lock; member
189 void lock_protect(void* lock, void* area, size_t size);
197 void lock_unprotect(void* lock, void* area);
204 size_t lock_get_mem(void* lock);
225 void checklock_init(enum check_lock_type type, struct checked_lock** lock,
236 void checklock_destroy(enum check_lock_type type, struct checked_lock** lock,
247 void checklock_rdlock(enum check_lock_type type, struct checked_lock* lock,
258 void checklock_wrlock(enum check_lock_type type, struct checked_lock* lock,
269 void checklock_lock(enum check_lock_type type, struct checked_lock* lock,
280 void checklock_unlock(enum check_lock_type type, struct checked_lock* lock,
[all …]
/netbsd-src/external/bsd/libevent/dist/
H A Devthread.c122 target->lock == cbs->lock && in evthread_set_lock_callbacks()
131 if (cbs->alloc && cbs->free && cbs->lock && cbs->unlock) { in evthread_set_lock_callbacks()
195 void *lock; member
205 if (!(result->lock = original_lock_fns_.alloc( in debug_lock_alloc()
211 result->lock = NULL; in debug_lock_alloc()
223 struct debug_lock *lock = lock_; in debug_lock_free() local
224 EVUTIL_ASSERT(lock->count == 0); in debug_lock_free()
225 EVUTIL_ASSERT(locktype == lock->locktype); in debug_lock_free()
226 EVUTIL_ASSERT(DEBUG_LOCK_SIG == lock->signature); in debug_lock_free()
228 original_lock_fns_.free(lock->lock, in debug_lock_free()
[all …]
/netbsd-src/sys/external/bsd/drm2/dist/drm/
H A Ddrm_lock.c68 volatile unsigned int *lock = &lock_data->hw_lock->lock; in drm_lock_take() local
72 old = *lock; in drm_lock_take()
80 prev = cmpxchg(lock, old, new); in drm_lock_take()
117 volatile unsigned int *lock = &lock_data->hw_lock->lock; in drm_lock_transfer() local
121 old = *lock; in drm_lock_transfer()
123 prev = cmpxchg(lock, old, new); in drm_lock_transfer()
132 volatile unsigned int *lock = &lock_data->hw_lock->lock; in drm_legacy_lock_free() local
144 old = *lock; in drm_legacy_lock_free()
146 prev = cmpxchg(lock, old, new); in drm_legacy_lock_free()
173 struct drm_lock *lock = data; in drm_legacy_lock() local
[all …]
/netbsd-src/crypto/external/bsd/heimdal/dist/lib/hx509/
H A Dlock.c65 hx509_lock_init(hx509_context context, hx509_lock *lock) in hx509_lock_init() argument
70 *lock = NULL; in hx509_lock_init()
86 *lock = l; in hx509_lock_init()
92 hx509_lock_add_password(hx509_lock lock, const char *password) in hx509_lock_add_password() argument
101 d = realloc(lock->password.val, in hx509_lock_add_password()
102 (lock->password.len + 1) * sizeof(lock->password.val[0])); in hx509_lock_add_password()
107 lock->password.val = d; in hx509_lock_add_password()
108 lock->password.val[lock->password.len] = s; in hx509_lock_add_password()
109 lock->password.len++; in hx509_lock_add_password()
115 _hx509_lock_get_passwords(hx509_lock lock) in _hx509_lock_get_passwords() argument
[all …]
/netbsd-src/sys/kern/
H A Dvfs_lockf.c58 * associated with a byte range lock. The lockf structures are linked into
59 * the vnode structure. Locks are sorted by the starting byte of the lock for
62 * lf_next is used for two purposes, depending on whether the lock is
63 * being held, or is in conflict with an existing lock. If this lock
64 * is held, it indicates the next lock on the same vnode.
65 * For pending locks, if lock->lf_next is non-NULL, then lock->lf_block
66 * must be queued on the lf_blkhd TAILQ of lock->lf_next.
75 off_t lf_start; /* The byte # of the start of the lock */
132 lf_print(const char * tag,struct lockf * lock) lf_print() argument
152 lf_printlist(const char * tag,struct lockf * lock) lf_printlist() argument
195 struct lockf *lock; lf_alloc() local
214 lf_free(struct lockf * lock) lf_free() argument
230 lf_findoverlap(struct lockf * lf,struct lockf * lock,int type,struct lockf *** prev,struct lockf ** overlap) lf_findoverlap() argument
477 lf_getblock(struct lockf * lock) lf_getblock() argument
501 lf_setlock(struct lockf * lock,struct lockf ** sparelock,kmutex_t * interlock) lf_setlock() argument
757 lf_getlock(struct lockf * lock,struct flock * fl) lf_getlock() argument
791 struct lockf *lock = NULL; lf_advlock() local
[all...]
/netbsd-src/external/gpl3/gcc.old/dist/libgomp/
H A Dlock.c37 gomp_init_lock_30 (omp_lock_t *lock) in gomp_init_lock_30() argument
39 gomp_mutex_init (lock); in gomp_init_lock_30()
43 gomp_destroy_lock_30 (omp_lock_t *lock) in gomp_destroy_lock_30() argument
45 gomp_mutex_destroy (lock); in gomp_destroy_lock_30()
49 gomp_set_lock_30 (omp_lock_t *lock) in gomp_set_lock_30() argument
51 gomp_mutex_lock (lock); in gomp_set_lock_30()
55 gomp_unset_lock_30 (omp_lock_t *lock) in gomp_unset_lock_30() argument
57 gomp_mutex_unlock (lock); in gomp_unset_lock_30()
61 gomp_test_lock_30 (omp_lock_t *lock) in gomp_test_lock_30() argument
65 return __atomic_compare_exchange_n (lock, &oldval, 1, false, in gomp_test_lock_30()
[all …]
H A Dfortran.c105 gomp_init_lock__30 (omp_lock_arg_t lock) in ialias_redirect()
108 omp_lock_arg (lock) = malloc (sizeof (omp_lock_t)); in ialias_redirect()
110 gomp_init_lock_30 (omp_lock_arg (lock)); in ialias_redirect()
114 gomp_init_nest_lock__30 (omp_nest_lock_arg_t lock) in gomp_init_nest_lock__30() argument
117 omp_nest_lock_arg (lock) = malloc (sizeof (omp_nest_lock_t)); in gomp_init_nest_lock__30()
119 gomp_init_nest_lock_30 (omp_nest_lock_arg (lock)); in gomp_init_nest_lock__30()
123 gomp_destroy_lock__30 (omp_lock_arg_t lock) in gomp_destroy_lock__30() argument
125 gomp_destroy_lock_30 (omp_lock_arg (lock)); in gomp_destroy_lock__30()
127 free (omp_lock_arg (lock)); in gomp_destroy_lock__30()
128 omp_lock_arg (lock) = NULL; in gomp_destroy_lock__30()
[all …]
/netbsd-src/external/gpl3/gcc/dist/libgomp/
H A Dlock.c37 gomp_init_lock_30 (omp_lock_t *lock) in gomp_init_lock_30() argument
39 gomp_mutex_init (lock); in gomp_init_lock_30()
43 gomp_destroy_lock_30 (omp_lock_t *lock) in gomp_destroy_lock_30() argument
45 gomp_mutex_destroy (lock); in gomp_destroy_lock_30()
49 gomp_set_lock_30 (omp_lock_t *lock) in gomp_set_lock_30() argument
51 gomp_mutex_lock (lock); in gomp_set_lock_30()
55 gomp_unset_lock_30 (omp_lock_t *lock) in gomp_unset_lock_30() argument
57 gomp_mutex_unlock (lock); in gomp_unset_lock_30()
61 gomp_test_lock_30 (omp_lock_t *lock) in gomp_test_lock_30() argument
65 return __atomic_compare_exchange_n (lock, &oldval, 1, false, in gomp_test_lock_30()
[all …]
/netbsd-src/crypto/external/bsd/openssl/dist/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 …]
H A Dthreads_pthread.c48 CRYPTO_RWLOCK *lock; in CRYPTO_THREAD_lock_new() local
50 if ((lock = OPENSSL_zalloc(sizeof(pthread_rwlock_t))) == NULL) { in CRYPTO_THREAD_lock_new()
55 if (pthread_rwlock_init(lock, NULL) != 0) { in CRYPTO_THREAD_lock_new()
56 OPENSSL_free(lock); in CRYPTO_THREAD_lock_new()
61 CRYPTO_RWLOCK *lock; in CRYPTO_THREAD_lock_new()
63 if ((lock = OPENSSL_zalloc(sizeof(pthread_mutex_t))) == NULL) { in CRYPTO_THREAD_lock_new()
80 if (pthread_mutex_init(lock, &attr) != 0) { in CRYPTO_THREAD_lock_new()
82 OPENSSL_free(lock); in CRYPTO_THREAD_lock_new()
89 return lock; in CRYPTO_THREAD_lock_new()
92 __owur int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *lock) in CRYPTO_THREAD_read_lock() argument
[all …]
/netbsd-src/sys/external/bsd/drm/dist/bsd-core/
H A Ddrm_lock.c54 struct drm_lock *lock = data; in drm_lock() local
57 if (lock->context == DRM_KERNEL_CONTEXT) { in drm_lock()
59 DRM_CURRENTPID, lock->context); in drm_lock()
64 lock->context, DRM_CURRENTPID, dev->lock.hw_lock->lock, in drm_lock()
65 lock->flags); in drm_lock()
68 lock->context < 0) in drm_lock()
73 if (drm_lock_take(&dev->lock, lock->context)) { in drm_lock()
74 dev->lock.file_priv = file_priv; in drm_lock()
75 dev->lock.lock_time = jiffies; in drm_lock()
82 ret = mtx_sleep((void *)&dev->lock.lock_queue, &dev->dev_lock, in drm_lock()
[all …]
/netbsd-src/sys/external/bsd/drm2/drm/
H A Ddrm_lock.c104 spin_lock(&master->lock.spinlock); in drm_legacy_lock()
106 if (master->lock.user_waiters == UINT32_MAX) { in drm_legacy_lock()
111 master->lock.user_waiters++; in drm_legacy_lock()
112 DRM_SPIN_WAIT_UNTIL(error, &master->lock.lock_queue, in drm_legacy_lock()
113 &master->lock.spinlock, in drm_legacy_lock()
114 ((master->lock.hw_lock == NULL) || in drm_legacy_lock()
115 drm_lock_acquire(&master->lock, lock_request->context))); in drm_legacy_lock()
116 KASSERT(0 < master->lock.user_waiters); in drm_legacy_lock()
117 master->lock.user_waiters--; in drm_legacy_lock()
122 if (master->lock.hw_lock == NULL) { in drm_legacy_lock()
[all …]
/netbsd-src/crypto/external/bsd/openssl.old/dist/crypto/
H A Dthreads_pthread.c27 CRYPTO_RWLOCK *lock; in CRYPTO_THREAD_lock_new() local
29 if ((lock = OPENSSL_zalloc(sizeof(pthread_rwlock_t))) == NULL) { in CRYPTO_THREAD_lock_new()
34 if (pthread_rwlock_init(lock, NULL) != 0) { in CRYPTO_THREAD_lock_new()
35 OPENSSL_free(lock); in CRYPTO_THREAD_lock_new()
40 CRYPTO_RWLOCK *lock; in CRYPTO_THREAD_lock_new()
42 if ((lock = OPENSSL_zalloc(sizeof(pthread_mutex_t))) == NULL) { in CRYPTO_THREAD_lock_new()
50 if (pthread_mutex_init(lock, &attr) != 0) { in CRYPTO_THREAD_lock_new()
52 OPENSSL_free(lock); in CRYPTO_THREAD_lock_new()
59 return lock; in CRYPTO_THREAD_lock_new()
62 int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *lock) in CRYPTO_THREAD_read_lock() argument
[all …]
H A Dthreads_win.c20 CRYPTO_RWLOCK *lock; in CRYPTO_THREAD_lock_new() local
22 if ((lock = OPENSSL_zalloc(sizeof(CRITICAL_SECTION))) == NULL) { in CRYPTO_THREAD_lock_new()
29 if (!InitializeCriticalSectionAndSpinCount(lock, 0x400)) { in CRYPTO_THREAD_lock_new()
30 OPENSSL_free(lock); in CRYPTO_THREAD_lock_new()
34 InitializeCriticalSection(lock); in CRYPTO_THREAD_lock_new()
37 return lock; in CRYPTO_THREAD_lock_new()
40 int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *lock) in CRYPTO_THREAD_read_lock() argument
42 EnterCriticalSection(lock); in CRYPTO_THREAD_read_lock()
46 int CRYPTO_THREAD_write_lock(CRYPTO_RWLOCK *lock) in CRYPTO_THREAD_write_lock() argument
48 EnterCriticalSection(lock); in CRYPTO_THREAD_write_lock()
[all …]
/netbsd-src/external/gpl2/xcvs/dist/src/
H A Dlock.c78 struct lock { struct
110 static int set_lock (struct lock *lock, int will_wait); argument
111 static void clear_lock (struct lock *lock);
135 static struct lock global_readlock = {NULL, NULL, NULL, CVSLCK, NULL, false};
136 static struct lock global_writelock = {NULL, NULL, NULL, CVSLCK, NULL, false};
138 static struct lock global_history_lock = {NULL, NULL, NULL, CVSHISTORYLCK,
140 static struct lock global_val_tags_lock = {NULL, NULL, NULL, CVSVALTAGSLCK,
143 static struct lock global_readlock = {NULL, NULL, CVSLCK, NULL, false};
144 static struct lock global_writelock = {NULL, NULL, CVSLCK, NULL, false};
146 static struct lock global_history_lock = {NULL, NULL, CVSHISTORYLCK, NULL,
[all …]

12345678910>>...95