/openbsd/sys/arch/hppa/hppa/ |
H A D | mutex.c | 39 #define __mtx_lock(mtx) ((int *)(((vaddr_t)mtx->mtx_lock + 0xf) & ~0xf)) argument 46 mtx->mtx_lock[0] = 1; in __mtx_init() 47 mtx->mtx_lock[1] = 1; in __mtx_init() 48 mtx->mtx_lock[2] = 1; in __mtx_init() 49 mtx->mtx_lock[3] = 1; in __mtx_init() 53 mtx->mtx_owner = NULL; in __mtx_init() 88 mtx->mtx_owner = ci; in mtx_enter_try() 115 mtx->mtx_oldipl = splraise(mtx->mtx_wantipl); in mtx_enter() 117 mtx->mtx_owner = ci; in mtx_enter() 127 mtx_enter(mtx); in mtx_enter_try() [all …]
|
/openbsd/sys/arch/m88k/m88k/ |
H A D | mutex.c | 47 mtx->mtx_lock = 0; in __mtx_init() 48 mtx->mtx_owner = NULL; in __mtx_init() 49 mtx->mtx_wantipl = wantipl; in __mtx_init() 94 mtx->mtx_owner = ci; in mtx_enter_try() 97 mtx->mtx_oldipl = s; in mtx_enter_try() 133 mtx->mtx_oldipl = splraise(mtx->mtx_wantipl); in mtx_enter() 135 mtx->mtx_owner = ci; in mtx_enter() 146 mtx_enter(mtx); in mtx_enter_try() 160 MUTEX_ASSERT_LOCKED(mtx); in mtx_leave() 167 s = mtx->mtx_oldipl; in mtx_leave() [all …]
|
/openbsd/sys/kern/ |
H A D | kern_lock.c | 221 mtx->mtx_owner = NULL; in __mtx_init() 245 __func__, mtx); in mtx_enter() 276 mtx->mtx_oldipl = s; in mtx_enter_try() 308 mtx->mtx_oldipl = splraise(mtx->mtx_wantipl); in mtx_enter() 310 mtx->mtx_owner = ci; in mtx_enter() 321 mtx_enter(mtx); in mtx_enter_try() 342 s = mtx->mtx_oldipl; in mtx_leave() 346 mtx->mtx_owner = NULL; in mtx_leave() 373 mtx->mtx_intr_state = s; in db_mtx_enter() 394 s = mtx->mtx_intr_state; in db_mtx_leave() [all …]
|
H A D | kern_synch.c | 205 msleep(const volatile void *ident, struct mutex *mtx, int priority, in msleep() argument 215 KASSERT(mtx != NULL); in msleep() 228 spl = MUTEX_OLDIPL(mtx); in msleep() 229 MUTEX_OLDIPL(mtx) = safepri; in msleep() 230 mtx_leave(mtx); in msleep() 238 mtx_enter(mtx); in msleep() 239 MUTEX_OLDIPL(mtx) = spl; in msleep() 247 mtx_leave(mtx); in msleep() 252 mtx_enter(mtx); in msleep() 264 return msleep(ident, mtx, priority, wmesg, 0); in msleep_nsec() [all …]
|
/openbsd/sys/arch/m88k/include/ |
H A D | mutex.h | 53 #define _mtx_init(mtx, ipl) __mtx_init((mtx), __MUTEX_IPL((ipl))) argument 57 #define MUTEX_ASSERT_LOCKED(mtx) do { \ argument 58 if (((mtx)->mtx_owner != curcpu()) && !(panicstr || db_active)) \ 59 panic("mutex %p not held in %s", (mtx), __func__); \ 62 #define MUTEX_ASSERT_UNLOCKED(mtx) do { \ argument 63 if (((mtx)->mtx_owner == curcpu()) && !(panicstr || db_active)) \ 64 panic("mutex %p held in %s", (mtx), __func__); \ 69 #define MUTEX_ASSERT_LOCKED(mtx) do { /* nothing */ } while (0) argument 70 #define MUTEX_ASSERT_UNLOCKED(mtx) do { /* nothing */ } while (0) argument 74 #define MUTEX_LOCK_OBJECT(mtx) (&(mtx)->mtx_lock_obj) argument [all …]
|
/openbsd/sys/arch/hppa/include/ |
H A D | mutex.h | 63 #define _mtx_init(mtx, ipl) __mtx_init((mtx), __MUTEX_IPL((ipl))) argument 66 #define MUTEX_ASSERT_LOCKED(mtx) do { \ argument 67 if ((mtx)->mtx_owner != curcpu()) \ 68 panic("mutex %p not held in %s", (mtx), __func__); \ 71 #define MUTEX_ASSERT_UNLOCKED(mtx) do { \ argument 72 if ((mtx)->mtx_owner == curcpu()) \ 73 panic("mutex %p held in %s", (mtx), __func__); \ 76 #define MUTEX_ASSERT_LOCKED(mtx) do { } while (0) argument 77 #define MUTEX_ASSERT_UNLOCKED(mtx) do { } while (0) argument 80 #define MUTEX_LOCK_OBJECT(mtx) (&(mtx)->mtx_lock_obj) argument [all …]
|
/openbsd/sys/sys/ |
H A D | mutex.h | 74 #define _mtx_init(mtx, ipl) __mtx_init((mtx), __MUTEX_IPL((ipl))) argument 77 #define MUTEX_ASSERT_LOCKED(mtx) do { \ argument 79 panic("mutex %p not held in %s", (mtx), __func__); \ 82 #define MUTEX_ASSERT_UNLOCKED(mtx) do { \ argument 84 panic("mutex %p held in %s", (mtx), __func__); \ 87 #define MUTEX_ASSERT_LOCKED(mtx) do { (void)(mtx); } while (0) argument 88 #define MUTEX_ASSERT_UNLOCKED(mtx) do { (void)(mtx); } while (0) argument 91 #define MUTEX_LOCK_OBJECT(mtx) (&(mtx)->mtx_lock_obj) argument 92 #define MUTEX_OLDIPL(mtx) (mtx)->mtx_oldipl argument 130 #define mtx_owned(mtx) \ argument [all …]
|
/openbsd/gnu/llvm/compiler-rt/lib/sanitizer_common/tests/ |
H A D | sanitizer_mutex_test.cpp | 26 explicit TestData(MutexType *mtx) in TestData() argument 27 : mtx_(mtx) { in TestData() 124 mtx->CheckLocked(); in check_locked() 128 SpinMutex mtx; in TEST() local 129 mtx.Init(); in TEST() 139 SpinMutex mtx; in TEST() local 140 mtx.Init(); in TEST() 150 Mutex mtx; in TEST() local 151 TestData<Mutex> data(&mtx); in TEST() 159 Mutex mtx; in TEST() local [all …]
|
/openbsd/gnu/llvm/compiler-rt/lib/tsan/tests/rtl/ |
H A D | tsan_posix.cpp | 20 pthread_mutex_t *mtx; member 23 thread_key(pthread_key_t key, pthread_mutex_t *mtx, int val, int *cnt) in thread_key() 25 , mtx(mtx) in thread_key() 33 EXPECT_EQ(__interceptor_pthread_mutex_lock(k->mtx), 0); in thread_secific_dtor() 36 EXPECT_EQ(__interceptor_pthread_mutex_unlock(k->mtx), 0); in thread_secific_dtor() 57 pthread_mutex_t mtx; in TEST() local 58 EXPECT_EQ(__interceptor_pthread_mutex_init(&mtx, 0), 0); in TEST() 60 thread_key k1 = thread_key(key, &mtx, 42, &cnt); in TEST() 61 thread_key k2 = thread_key(key, &mtx, 43, &cnt); in TEST() 62 thread_key k3 = thread_key(key, &mtx, 44, &cnt); in TEST()
|
H A D | tsan_test_util_posix.cpp | 49 pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER; in TestMutexBeforeInit() local 50 __interceptor_pthread_mutex_lock(&mtx); in TestMutexBeforeInit() 51 __interceptor_pthread_mutex_unlock(&mtx); in TestMutexBeforeInit() 52 __interceptor_pthread_mutex_destroy(&mtx); in TestMutexBeforeInit()
|
/openbsd/gnu/llvm/compiler-rt/lib/sanitizer_common/ |
H A D | sanitizer_deadlock_detector2.cpp | 77 StaticSpinMutex mtx; member 111 SpinMutex mtx; member 170 SpinMutexLock l(&mtx); in allocateId() 222 SpinMutexLock l(&mtx1->mtx); in MutexBeforeLock() 232 link->seq = mtx->seq; in MutexBeforeLock() 247 link->seq = mtx->seq; in MutexBeforeLock() 344 SpinMutexLock l(&mtx->mtx); in MutexDestroy() 345 mtx->seq++; in MutexDestroy() 346 mtx->nlink = 0; in MutexDestroy() 351 SpinMutexLock l(&mtx); in MutexDestroy() [all …]
|
H A D | sanitizer_addrhashmap.h | 64 Mutex mtx; member 117 ReadLock lock(&bucket->mtx); in ForEach() 235 b->mtx.ReadLock(); in acquire() 246 b->mtx.ReadUnlock(); in acquire() 252 b->mtx.Lock(); in acquire() 261 b->mtx.Unlock(); in acquire() 278 b->mtx.Unlock(); in acquire() 286 b->mtx.Unlock(); in acquire() 347 b->mtx.Unlock(); in release() 376 b->mtx.Unlock(); in release() [all …]
|
H A D | sanitizer_deadlock_detector1.cpp | 36 SpinMutex mtx; member 108 SpinMutexLock lk(&mtx); in MutexBeforeLock() 163 SpinMutexLock lk(&mtx); in MutexAfterLock() 180 SpinMutexLock lk(&mtx); in MutexDestroy()
|
/openbsd/sys/scsi/ |
H A D | scsi_base.c | 109 struct mutex mtx; member 216 mtx_enter(mtx); in scsi_pending_start() 220 mtx_leave(mtx); in scsi_pending_start() 230 mtx_enter(mtx); in scsi_pending_finish() 236 mtx_leave(mtx); in scsi_pending_finish() 280 mtx_enter(&iopl->mtx); in scsi_iopool_destroy() 292 mtx_leave(&iopl->mtx); in scsi_iopool_destroy() 446 mtx_enter(&m->mtx); in scsi_move() 449 mtx_leave(&m->mtx); in scsi_move() 457 mtx_enter(&m->mtx); in scsi_move_done() [all …]
|
/openbsd/sys/uvm/ |
H A D | uvm_km.c | 557 mtx_enter(&uvm_km_pages.mtx); in uvm_km_thread() 567 mtx_leave(&uvm_km_pages.mtx); in uvm_km_thread() 594 mtx_enter(&uvm_km_pages.mtx); in uvm_km_thread() 604 mtx_leave(&uvm_km_pages.mtx); in uvm_km_thread() 633 mtx_enter(&uvm_km_pages.mtx); in uvm_km_doputpage() 638 mtx_leave(&uvm_km_pages.mtx); in uvm_km_doputpage() 718 mtx_enter(&uvm_km_pages.mtx); in km_alloc() 721 mtx_leave(&uvm_km_pages.mtx); in km_alloc() 735 mtx_leave(&uvm_km_pages.mtx); in km_alloc() 800 mtx_enter(&uvm_km_pages.mtx); in km_free() [all …]
|
H A D | uvm_km.h | 61 struct mutex mtx; member
|
/openbsd/gnu/llvm/compiler-rt/lib/tsan/rtl/ |
H A D | tsan_rtl_mutex.cpp | 109 Lock lock(&s->mtx); in MutexDestroy() 150 ReadLock lock(&s->mtx); in MutexPreLock() 177 Lock lock(&s->mtx); in MutexPostLock() 229 Lock lock(&s->mtx); in MutexUnlock() 336 Lock lock(&s->mtx); in MutexReadUnlock() 378 Lock lock(&s->mtx); in MutexReadOrWriteUnlock() 423 Lock lock(&s->mtx); in MutexRepair() 451 ReadLock lock(&s->mtx); in Acquire() 470 Lock lock(&s->mtx); in Release() 483 Lock lock(&s->mtx); in ReleaseStore() [all …]
|
H A D | tsan_rtl.cpp | 150 Lock lock(&trace->mtx); in DoResetImpl() 234 slot.mtx.Lock(); in DoReset() 240 slot.mtx.Unlock(); in DoReset() 265 slot->mtx.Unlock(); in FindSlotAndLock() 281 slot->mtx.Lock(); in FindSlotAndLock() 328 Lock l(&trace->mtx); in SlotDetachImpl() 352 Lock lock(&thr->slot->mtx); in SlotDetach() 366 slot->mtx.Lock(); in SlotLock() 372 slot->mtx.Unlock(); in SlotLock() 379 thr->slot->mtx.Unlock(); in SlotUnlock() [all …]
|
H A D | tsan_mman.cpp | 58 Mutex mtx; member 68 : mtx(MutexTypeGlobalProc), in GlobalProc() 102 gp->mtx.Lock(); in ScopedGlobalProcessor() 112 gp->mtx.Unlock(); in ~ScopedGlobalProcessor() 126 global_proc()->mtx.Lock(); in GlobalProcessorLock() 130 global_proc()->mtx.Unlock(); in GlobalProcessorUnlock()
|
H A D | tsan_trace.h | 190 Mutex mtx; member 201 Trace() : mtx(MutexTypeTrace) {} in Trace()
|
H A D | tsan_interface_ann.cpp | 72 Mutex mtx; member 75 DynamicAnnContext() : mtx(MutexTypeAnnotations) {} in DynamicAnnContext() 142 ReadLock lock(&dyn_ann_ctx->mtx); in IsExpectedReport() 251 Lock lock(&dyn_ann_ctx->mtx); in BenignRaceImpl()
|
/openbsd/sys/dev/pci/drm/include/linux/ |
H A D | wait.h | 226 #define __wait_event_lock_irq(wqh, condition, mtx) \ argument 240 mtx_leave(&(mtx)); \ 242 mtx_enter(&(mtx)); \ 251 #define wait_event_lock_irq(wqh, condition, mtx) \ argument 254 __wait_event_lock_irq(wqh, condition, mtx); \
|
/openbsd/regress/lib/libc/locale/uselocale/ |
H A D | uselocale.c | 181 static pthread_mutex_t mtx; variable 202 if ((irc = pthread_mutex_trylock(&mtx)) != 0) in switch_thread() 206 if ((irc = pthread_cond_timedwait(&cond, &mtx, &t)) != 0) in switch_thread() 208 if ((irc = pthread_mutex_unlock(&mtx)) != 0) in switch_thread() 439 if ((irc = pthread_mutex_init(&mtx, &mtxattr)) != 0) in main()
|
/openbsd/gnu/llvm/compiler-rt/lib/tsan/tests/unit/ |
H A D | tsan_trace_test.cpp | 89 Lock slot_lock(&ctx->slots[static_cast<uptr>(thr->fast_state.sid())].mtx); in TRACE_TEST() 149 Lock slot_lock(&ctx->slots[static_cast<uptr>(thr->fast_state.sid())].mtx); in TRACE_TEST() 177 Lock slot_lock(&ctx->slots[static_cast<uptr>(thr->fast_state.sid())].mtx); in TRACE_TEST() 220 Lock slot_lock(&ctx->slots[static_cast<uptr>(thr->fast_state.sid())].mtx); in TRACE_TEST()
|
/openbsd/sys/net/ |
H A D | if_pfsync.c | 1309 mtx_enter(&st->mtx); in pfsync_out_state() 1311 mtx_leave(&st->mtx); in pfsync_out_state() 1332 mtx_enter(&st->mtx); in pfsync_out_upd_c() 1336 mtx_leave(&st->mtx); in pfsync_out_upd_c() 2163 mtx_enter(&st->mtx); in pfsync_bulk_snd_states() 2165 mtx_leave(&st->mtx); in pfsync_bulk_snd_states() 2931 mtx_enter(&st->mtx); in pfsync_in_updates() 2969 mtx_leave(&st->mtx); in pfsync_in_updates() 3205 mtx_enter(&st->mtx); in pfsync_in_del() 3207 mtx_leave(&st->mtx); in pfsync_in_del() [all …]
|