/external/virglrenderer/src/mesa/util/ |
D | simple_mtx.h | 67 simple_mtx_init(simple_mtx_t *mtx, ASSERTED int type) in simple_mtx_init() argument 71 mtx->val = 0; in simple_mtx_init() 75 simple_mtx_destroy(ASSERTED simple_mtx_t *mtx) in simple_mtx_destroy() argument 78 mtx->val = _SIMPLE_MTX_INVALID_VALUE; in simple_mtx_destroy() 83 simple_mtx_lock(simple_mtx_t *mtx) in simple_mtx_lock() argument 87 c = __sync_val_compare_and_swap(&mtx->val, 0, 1); in simple_mtx_lock() 93 c = __sync_lock_test_and_set(&mtx->val, 2); in simple_mtx_lock() 95 futex_wait(&mtx->val, 2, NULL); in simple_mtx_lock() 96 c = __sync_lock_test_and_set(&mtx->val, 2); in simple_mtx_lock() 102 simple_mtx_unlock(simple_mtx_t *mtx) in simple_mtx_unlock() argument [all …]
|
/external/mesa3d/src/util/ |
D | simple_mtx.h | 67 simple_mtx_init(simple_mtx_t *mtx, ASSERTED int type) in simple_mtx_init() argument 71 mtx->val = 0; in simple_mtx_init() 75 simple_mtx_destroy(ASSERTED simple_mtx_t *mtx) in simple_mtx_destroy() argument 78 mtx->val = _SIMPLE_MTX_INVALID_VALUE; in simple_mtx_destroy() 83 simple_mtx_lock(simple_mtx_t *mtx) in simple_mtx_lock() argument 87 c = __sync_val_compare_and_swap(&mtx->val, 0, 1); in simple_mtx_lock() 93 c = __sync_lock_test_and_set(&mtx->val, 2); in simple_mtx_lock() 95 futex_wait(&mtx->val, 2, NULL); in simple_mtx_lock() 96 c = __sync_lock_test_and_set(&mtx->val, 2); in simple_mtx_lock() 102 simple_mtx_unlock(simple_mtx_t *mtx) in simple_mtx_unlock() argument [all …]
|
/external/jemalloc_new/test/src/ |
D | mtx.c | 8 mtx_init(mtx_t *mtx) { in mtx_init() argument 10 if (!InitializeCriticalSectionAndSpinCount(&mtx->lock, in mtx_init() 15 mtx->lock = OS_UNFAIR_LOCK_INIT; in mtx_init() 17 mtx->lock = 0; in mtx_init() 25 if (pthread_mutex_init(&mtx->lock, &attr) != 0) { in mtx_init() 35 mtx_fini(mtx_t *mtx) { in mtx_fini() argument 40 pthread_mutex_destroy(&mtx->lock); in mtx_fini() 45 mtx_lock(mtx_t *mtx) { in mtx_lock() argument 47 EnterCriticalSection(&mtx->lock); in mtx_lock() 49 os_unfair_lock_lock(&mtx->lock); in mtx_lock() [all …]
|
/external/virglrenderer/src/mesa/compat/c11/ |
D | threads_posix.h | 135 cnd_timedwait(cnd_t *cond, mtx_t *mtx, const struct timespec *abs_time) in cnd_timedwait() argument 139 assert(mtx != NULL); in cnd_timedwait() 143 rt = pthread_cond_timedwait(cond, mtx, abs_time); in cnd_timedwait() 151 cnd_wait(cnd_t *cond, mtx_t *mtx) in cnd_wait() argument 153 assert(mtx != NULL); in cnd_wait() 155 return (pthread_cond_wait(cond, mtx) == 0) ? thrd_success : thrd_error; in cnd_wait() 162 mtx_destroy(mtx_t *mtx) in mtx_destroy() argument 164 assert(mtx != NULL); in mtx_destroy() 165 pthread_mutex_destroy(mtx); in mtx_destroy() 196 mtx_init(mtx_t *mtx, int type) in mtx_init() argument [all …]
|
D | threads_win32.h | 101 static inline int mtx_trylock(mtx_t *mtx); 102 static inline int mtx_lock(mtx_t *mtx); 103 static inline int mtx_unlock(mtx_t *mtx); 253 cnd_timedwait(cnd_t *cond, mtx_t *mtx, const struct timespec *abs_time) in cnd_timedwait() argument 256 assert(mtx != NULL); in cnd_timedwait() 260 if (SleepConditionVariableCS(cond, mtx, timeout)) in cnd_timedwait() 270 cnd_wait(cnd_t *cond, mtx_t *mtx) in cnd_wait() argument 273 assert(mtx != NULL); in cnd_wait() 274 SleepConditionVariableCS(cond, mtx, INFINITE); in cnd_wait() 282 mtx_destroy(mtx_t *mtx) in mtx_destroy() argument [all …]
|
/external/mesa3d/include/c11/ |
D | threads_posix.h | 135 cnd_timedwait(cnd_t *cond, mtx_t *mtx, const struct timespec *abs_time) in cnd_timedwait() argument 139 assert(mtx != NULL); in cnd_timedwait() 143 rt = pthread_cond_timedwait(cond, mtx, abs_time); in cnd_timedwait() 151 cnd_wait(cnd_t *cond, mtx_t *mtx) in cnd_wait() argument 153 assert(mtx != NULL); in cnd_wait() 155 return (pthread_cond_wait(cond, mtx) == 0) ? thrd_success : thrd_error; in cnd_wait() 162 mtx_destroy(mtx_t *mtx) in mtx_destroy() argument 164 assert(mtx != NULL); in mtx_destroy() 165 pthread_mutex_destroy(mtx); in mtx_destroy() 196 mtx_init(mtx_t *mtx, int type) in mtx_init() argument [all …]
|
D | threads_win32.h | 125 static inline int mtx_trylock(mtx_t *mtx); 126 static inline int mtx_lock(mtx_t *mtx); 127 static inline int mtx_unlock(mtx_t *mtx); 213 static int impl_cond_do_wait(cnd_t *cond, mtx_t *mtx, const struct timespec *ts) in impl_cond_do_wait() argument 224 mtx_unlock(mtx); in impl_cond_do_wait() 261 mtx_lock(mtx); in impl_cond_do_wait() 385 cnd_timedwait(cnd_t *cond, mtx_t *mtx, const struct timespec *abs_time) in cnd_timedwait() argument 387 if (!cond || !mtx || !abs_time) return thrd_error; in cnd_timedwait() 389 if (SleepConditionVariableCS(&cond->condvar, mtx, impl_timespec2msec(abs_time))) in cnd_timedwait() 393 return impl_cond_do_wait(cond, mtx, abs_time); in cnd_timedwait() [all …]
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/ |
D | 4-1.c | 89 static pthread_mutex_t mtx; variable 97 ret = pthread_mutex_trylock(&mtx); in threaded() 110 if ((ret = pthread_mutex_lock(&mtx))) { in threaded() 123 if ((ret = pthread_mutex_unlock(&mtx))) { in threaded() 161 if ((ret = pthread_mutex_init(&mtx, &ma))) { in main() 172 if ((ret = pthread_mutex_lock(&mtx))) { in main() 176 if ((ret = pthread_mutex_lock(&mtx))) { in main() 180 if ((ret = pthread_mutex_unlock(&mtx))) { in main() 204 if ((ret = pthread_mutex_unlock(&mtx))) { in main() 214 ret = pthread_mutex_unlock(&mtx); in main() [all …]
|
/external/compiler-rt/lib/sanitizer_common/tests/ |
D | sanitizer_mutex_test.cc | 27 explicit TestData(MutexType *mtx) in TestData() argument 28 : mtx_(mtx) { in TestData() 98 static void check_locked(MutexType *mtx) { in check_locked() argument 99 GenericScopedLock<MutexType> l(mtx); in check_locked() 100 mtx->CheckLocked(); in check_locked() 104 SpinMutex mtx; in TEST() local 105 mtx.Init(); in TEST() 106 TestData<SpinMutex> data(&mtx); in TEST() 115 SpinMutex mtx; in TEST() local 116 mtx.Init(); in TEST() [all …]
|
/external/compiler-rt/test/tsan/ |
D | bench_rwmutex.cc | 9 pthread_rwlock_t mtx; variable 13 pthread_rwlock_rdlock(&mtx); in thread() 14 pthread_rwlock_unlock(&mtx); in thread() 19 pthread_rwlock_init(&mtx, 0); in bench() 20 pthread_rwlock_wrlock(&mtx); in bench() 21 pthread_rwlock_unlock(&mtx); in bench() 22 pthread_rwlock_rdlock(&mtx); in bench() 23 pthread_rwlock_unlock(&mtx); in bench()
|
D | bench_local_mutex.cc | 9 pthread_mutex_t *mtx; variable 14 pthread_mutex_lock(&mtx[tid * kStride]); in thread() 15 pthread_mutex_unlock(&mtx[tid * kStride]); in thread() 20 mtx = (pthread_mutex_t*)malloc(bench_nthread * kStride * sizeof(*mtx)); in bench() 22 pthread_mutex_init(&mtx[i * kStride], 0); in bench() 23 pthread_mutex_lock(&mtx[i * kStride]); in bench() 24 pthread_mutex_unlock(&mtx[i * kStride]); in bench()
|
D | free_race.c | 8 pthread_mutex_t mtx; variable 11 pthread_mutex_lock(&mtx); in Thread1() 13 pthread_mutex_unlock(&mtx); in Thread1() 20 pthread_mutex_lock(&mtx); in Thread2() 22 pthread_mutex_unlock(&mtx); in Thread2() 29 pthread_mutex_init(&mtx, 0); in main() 34 pthread_mutex_destroy(&mtx); in main()
|
D | mutexset8.cc | 5 pthread_mutex_t *mtx; variable 9 pthread_mutex_lock(mtx); in Thread1() 11 pthread_mutex_unlock(mtx); in Thread1() 30 mtx = new pthread_mutex_t; in main() 31 pthread_mutex_init(mtx, 0); in main() 37 pthread_mutex_destroy(mtx); in main() 38 delete mtx; in main()
|
D | mutexset7.cc | 14 pthread_mutex_t *mtx = new pthread_mutex_t; in Thread2() local 15 pthread_mutex_init(mtx, 0); in Thread2() 16 pthread_mutex_lock(mtx); in Thread2() 18 pthread_mutex_unlock(mtx); in Thread2() 19 pthread_mutex_destroy(mtx); in Thread2() 20 delete mtx; in Thread2()
|
/external/jemalloc_new/test/unit/ |
D | mtx.c | 7 mtx_t mtx; in TEST_BEGIN() local 9 assert_false(mtx_init(&mtx), "Unexpected mtx_init() failure"); in TEST_BEGIN() 10 mtx_lock(&mtx); in TEST_BEGIN() 11 mtx_unlock(&mtx); in TEST_BEGIN() 12 mtx_fini(&mtx); in TEST_BEGIN() 17 mtx_t mtx; member 27 mtx_lock(&arg->mtx); in thd_start() 29 mtx_unlock(&arg->mtx); in thd_start() 39 assert_false(mtx_init(&arg.mtx), "Unexpected mtx_init() failure"); in TEST_BEGIN()
|
/external/jemalloc_new/src/ |
D | background_thread.c | 120 if (malloc_mutex_trylock(tsdn, &decay->mtx)) { 197 malloc_mutex_unlock(tsdn, &decay->mtx); 234 ret = pthread_cond_wait(&info->cond, &info->mtx.lock); 257 ret = pthread_cond_timedwait(&info->cond, &info->mtx.lock, &ts); 276 malloc_mutex_unlock(tsdn, &info->mtx); 280 malloc_mutex_lock(tsdn, &info->mtx); 323 malloc_mutex_lock(tsd_tsdn(tsd), &info->mtx); 333 malloc_mutex_unlock(tsd_tsdn(tsd), &info->mtx); 394 malloc_mutex_unlock(tsdn, &background_thread_info[0].mtx); 400 malloc_mutex_lock(tsdn, &info->mtx); [all …]
|
/external/ltp/testcases/open_posix_testsuite/stress/threads/pthread_mutex_trylock/ |
D | stress.c | 124 pthread_mutex_t *mtx; member 166 ret = pthread_mutex_trylock(td->mtx); in threaded() 194 ret = pthread_mutex_unlock(td->mtx); in threaded() 217 pthread_mutex_t mtx[NSCENAR + 2]; in main() local 274 ret = pthread_mutex_init(&mtx[i], &ma); in main() 292 ret = pthread_mutex_init(&mtx[i], &ma); in main() 301 ret = pthread_mutex_init(&mtx[i + 1], NULL); in main() 316 td.mtx = &mtx[i]; in main() 319 ret = pthread_mutex_lock(td.mtx); in main() 342 ret = pthread_mutex_unlock(td.mtx); in main() [all …]
|
/external/webrtc/modules/desktop_capture/win/ |
D | window_capture_utils_unittest.cc | 31 std::unique_ptr<rtc::Thread> SetUpUnresponsiveWindow(std::mutex& mtx, in SetUpUnresponsiveWindow() argument 41 mtx.lock(); in SetUpUnresponsiveWindow() 42 window_thread->PostTask([&mtx]() { in SetUpUnresponsiveWindow() 43 mtx.lock(); in SetUpUnresponsiveWindow() 44 mtx.unlock(); in SetUpUnresponsiveWindow() 67 std::mutex mtx; in TEST() local 70 SetUpUnresponsiveWindow(mtx, info); in TEST() 84 mtx.unlock(); in TEST() 90 std::mutex mtx; in TEST() local 93 SetUpUnresponsiveWindow(mtx, info); in TEST() [all …]
|
/external/compiler-rt/lib/tsan/tests/rtl/ |
D | tsan_posix.cc | 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(pthread_mutex_lock(k->mtx), 0); in thread_secific_dtor() 36 EXPECT_EQ(pthread_mutex_unlock(k->mtx), 0); in thread_secific_dtor() 57 pthread_mutex_t mtx; in TEST() local 58 EXPECT_EQ(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()
|
/external/compiler-rt/lib/sanitizer_common/ |
D | sanitizer_deadlock_detector2.cc | 78 StaticSpinMutex mtx; member 102 void CycleCheck(DDPhysicalThread *pt, DDLogicalThread *lt, DDMutex *mtx); 112 SpinMutex mtx; member 177 SpinMutexLock l(&mtx); in allocateId() 224 Mutex *mtx = getMutex(m->id); in MutexBeforeLock() local 229 SpinMutexLock l(&mtx1->mtx); in MutexBeforeLock() 238 if (link->seq != mtx->seq) { in MutexBeforeLock() 239 link->seq = mtx->seq; in MutexBeforeLock() 254 link->seq = mtx->seq; in MutexBeforeLock() 264 if (!added || mtx->nlink == 0) { in MutexBeforeLock() [all …]
|
/external/webp/src/dsp/ |
D | enc_sse41.c | 202 const VP8Matrix* const mtx) { in DoQuantizeBlock_SSE41() argument 211 const __m128i iq0 = _mm_loadu_si128((const __m128i*)&mtx->iq_[0]); in DoQuantizeBlock_SSE41() 212 const __m128i iq8 = _mm_loadu_si128((const __m128i*)&mtx->iq_[8]); in DoQuantizeBlock_SSE41() 213 const __m128i q0 = _mm_loadu_si128((const __m128i*)&mtx->q_[0]); in DoQuantizeBlock_SSE41() 214 const __m128i q8 = _mm_loadu_si128((const __m128i*)&mtx->q_[8]); in DoQuantizeBlock_SSE41() 241 const __m128i bias_00 = _mm_loadu_si128((const __m128i*)&mtx->bias_[0]); in DoQuantizeBlock_SSE41() 242 const __m128i bias_04 = _mm_loadu_si128((const __m128i*)&mtx->bias_[4]); in DoQuantizeBlock_SSE41() 243 const __m128i bias_08 = _mm_loadu_si128((const __m128i*)&mtx->bias_[8]); in DoQuantizeBlock_SSE41() 244 const __m128i bias_12 = _mm_loadu_si128((const __m128i*)&mtx->bias_[12]); in DoQuantizeBlock_SSE41() 304 const VP8Matrix* const mtx) { in QuantizeBlock_SSE41() argument [all …]
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/ |
D | 2-3.c | 82 pthread_mutex_t mtx; member 97 ret = pthread_mutex_trylock(&(data.mtx)); in clnp1() 102 ret = pthread_mutex_unlock(&(data.mtx)); in clnp1() 141 ret = pthread_mutex_unlock(&(data.mtx)); in clnp3() 148 ret = pthread_mutex_unlock(&(data.mtx)); in clnp3() 166 ret = pthread_mutex_lock(&(data.mtx)); in threaded() 184 ret = pthread_cond_wait(&(data.cnd), &(data.mtx)); in threaded() 339 ret = pthread_mutex_init(&(data.mtx), &ma); in main() 374 ret = pthread_mutex_lock(&(data.mtx)); in main() 390 ret = pthread_mutex_unlock(&(data.mtx)); in main() [all …]
|
/external/jemalloc_new/include/jemalloc/internal/ |
D | arena_stats.h | 59 malloc_mutex_t mtx; member 105 if (malloc_mutex_init(&arena_stats->mtx, "arena_stats", in arena_stats_init() 117 malloc_mutex_lock(tsdn, &arena_stats->mtx); in arena_stats_lock() 124 malloc_mutex_unlock(tsdn, &arena_stats->mtx); in arena_stats_unlock() 134 malloc_mutex_assert_owner(tsdn, &arena_stats->mtx); in arena_stats_read_u64() 145 malloc_mutex_assert_owner(tsdn, &arena_stats->mtx); in arena_stats_add_u64() 157 malloc_mutex_assert_owner(tsdn, &arena_stats->mtx); in arena_stats_sub_u64() 183 malloc_mutex_assert_owner(tsdn, &arena_stats->mtx); in arena_stats_read_zu() 194 malloc_mutex_assert_owner(tsdn, &arena_stats->mtx); in arena_stats_add_zu() 207 malloc_mutex_assert_owner(tsdn, &arena_stats->mtx); in arena_stats_sub_zu()
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/ |
D | 2-1.c | 85 pthread_mutex_t mtx; member 111 td->status = pthread_mutex_trylock(&(td->mtx)); in tf() 116 ret = pthread_mutex_unlock(&(td->mtx)); in tf() 282 ret = pthread_mutex_init(&(td->mtx), &ma); in main() 294 ret = pthread_mutex_trylock(&(td->mtx)); in main() 298 ret = pthread_mutex_trylock(&(td->mtx)); in main() 307 ret = pthread_mutex_unlock(&(td->mtx)); in main() 394 ret = pthread_mutex_unlock(&(td->mtx)); in main() 400 ret = pthread_mutex_unlock(&(td->mtx)); in main() 409 ret = pthread_mutex_destroy(&(td->mtx)); in main()
|
/external/compiler-rt/lib/tsan/tests/unit/ |
D | tsan_mutex_test.cc | 25 explicit TestData(MutexType *mtx) in TestData() argument 26 : mtx_(mtx) { in TestData() 97 Mutex mtx(MutexTypeAnnotations, StatMtxAnnotations); in TEST() local 98 TestData<Mutex> data(&mtx); in TEST() 107 Mutex mtx(MutexTypeAnnotations, StatMtxAnnotations); in TEST() local 108 TestData<Mutex> data(&mtx); in TEST() 117 SpinMutex mtx; in TEST() local 118 TestData<SpinMutex> data(&mtx); in TEST()
|