/external/mesa3d/src/util/ |
D | simple_mtx.h | 64 simple_mtx_init(simple_mtx_t *mtx, MAYBE_UNUSED int type) in simple_mtx_init() argument 68 mtx->val = 0; in simple_mtx_init() 72 simple_mtx_destroy(UNUSED simple_mtx_t *mtx) in simple_mtx_destroy() argument 77 simple_mtx_lock(simple_mtx_t *mtx) in simple_mtx_lock() argument 81 c = __sync_val_compare_and_swap(&mtx->val, 0, 1); in simple_mtx_lock() 84 c = __sync_lock_test_and_set(&mtx->val, 2); in simple_mtx_lock() 86 futex_wait(&mtx->val, 2, NULL); in simple_mtx_lock() 87 c = __sync_lock_test_and_set(&mtx->val, 2); in simple_mtx_lock() 93 simple_mtx_unlock(simple_mtx_t *mtx) in simple_mtx_unlock() argument 97 c = __sync_fetch_and_sub(&mtx->val, 1); in simple_mtx_unlock() [all …]
|
/external/jemalloc/test/src/ |
D | mtx.c | 8 mtx_init(mtx_t *mtx) in mtx_init() argument 12 if (!InitializeCriticalSectionAndSpinCount(&mtx->lock, _CRT_SPINCOUNT)) in mtx_init() 15 mtx->lock = OS_UNFAIR_LOCK_INIT; in mtx_init() 17 mtx->lock = 0; in mtx_init() 24 if (pthread_mutex_init(&mtx->lock, &attr) != 0) { in mtx_init() 34 mtx_fini(mtx_t *mtx) in mtx_fini() argument 41 pthread_mutex_destroy(&mtx->lock); in mtx_fini() 46 mtx_lock(mtx_t *mtx) in mtx_lock() argument 50 EnterCriticalSection(&mtx->lock); in mtx_lock() 52 os_unfair_lock_lock(&mtx->lock); in mtx_lock() [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/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 | 135 static inline int mtx_trylock(mtx_t *mtx); 136 static inline int mtx_lock(mtx_t *mtx); 137 static inline int mtx_unlock(mtx_t *mtx); 223 static int impl_cond_do_wait(cnd_t *cond, mtx_t *mtx, const struct timespec *ts) in impl_cond_do_wait() argument 234 mtx_unlock(mtx); in impl_cond_do_wait() 271 mtx_lock(mtx); in impl_cond_do_wait() 395 cnd_timedwait(cnd_t *cond, mtx_t *mtx, const struct timespec *abs_time) in cnd_timedwait() argument 397 if (!cond || !mtx || !abs_time) return thrd_error; in cnd_timedwait() 399 if (SleepConditionVariableCS(&cond->condvar, mtx, impl_timespec2msec(abs_time))) in cnd_timedwait() 403 return impl_cond_do_wait(cond, mtx, abs_time); in cnd_timedwait() [all …]
|
/external/virglrenderer/src/gallium/include/c11/ |
D | threads_posix.h | 135 cnd_timedwait(cnd_t *cond, mtx_t *mtx, const xtime *xt) in cnd_timedwait() argument 140 assert(mtx != NULL); in cnd_timedwait() 147 rt = pthread_cond_timedwait(cond, mtx, &abs_time); in cnd_timedwait() 155 cnd_wait(cnd_t *cond, mtx_t *mtx) in cnd_wait() argument 157 assert(mtx != NULL); in cnd_wait() 159 return (pthread_cond_wait(cond, mtx) == 0) ? thrd_success : thrd_error; in cnd_wait() 166 mtx_destroy(mtx_t *mtx) in mtx_destroy() argument 168 assert(mtx != NULL); in mtx_destroy() 169 pthread_mutex_destroy(mtx); in mtx_destroy() 174 mtx_init(mtx_t *mtx, int type) in mtx_init() argument [all …]
|
D | threads_win32.h | 121 static inline int mtx_trylock(mtx_t *mtx); 122 static inline int mtx_lock(mtx_t *mtx); 123 static inline int mtx_unlock(mtx_t *mtx); 209 static int impl_cond_do_wait(cnd_t *cond, mtx_t *mtx, const xtime *xt) in impl_cond_do_wait() argument 220 mtx_unlock(mtx); in impl_cond_do_wait() 257 mtx_lock(mtx); in impl_cond_do_wait() 381 cnd_timedwait(cnd_t *cond, mtx_t *mtx, const xtime *xt) in cnd_timedwait() argument 383 if (!cond || !mtx || !xt) return thrd_error; in cnd_timedwait() 385 if (SleepConditionVariableCS(&cond->condvar, mtx, impl_xtime2msec(xt))) in cnd_timedwait() 389 return impl_cond_do_wait(cond, mtx, xt); in cnd_timedwait() [all …]
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/ |
D | 4-1.c | 89 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/test/unit/ |
D | mtx.c | 8 mtx_t mtx; in TEST_BEGIN() local 10 assert_false(mtx_init(&mtx), "Unexpected mtx_init() failure"); in TEST_BEGIN() 11 mtx_lock(&mtx); in TEST_BEGIN() 12 mtx_unlock(&mtx); in TEST_BEGIN() 13 mtx_fini(&mtx); in TEST_BEGIN() 18 mtx_t mtx; member 29 mtx_lock(&arg->mtx); in thd_start() 31 mtx_unlock(&arg->mtx); in thd_start() 42 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/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/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() 336 ret = pthread_mutex_init(&(data.mtx), &ma); in main() 371 ret = pthread_mutex_lock(&(data.mtx)); in main() 389 ret = pthread_mutex_unlock(&(data.mtx)); in main() [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_timedwait/ |
D | 2-6.c | 52 pthread_mutex_t mtx; member 71 ret = pthread_mutex_trylock(&(data.mtx)); in clnp1() 76 ret = pthread_mutex_unlock(&(data.mtx)); in clnp1() 120 ret = pthread_mutex_unlock(&(data.mtx)); in clnp3() 127 ret = pthread_mutex_unlock(&(data.mtx)); in clnp3() 156 ret = pthread_mutex_lock(&(data.mtx)); in threaded() 173 ret = pthread_cond_timedwait(&(data.cnd), &(data.mtx), &ts); in threaded() 326 ret = pthread_mutex_init(&(data.mtx), &ma); in main() 370 ret = pthread_mutex_lock(&(data.mtx)); in main() 388 ret = pthread_mutex_unlock(&(data.mtx)); in main() [all …]
|
/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/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()
|