Home
last modified time | relevance | path

Searched refs:mutex (Results 1 – 25 of 919) sorted by relevance

12345678910>>...37

/third_party/mbedtls/tests/src/
Dthreading_helpers.c99 static void mbedtls_test_mutex_usage_error(mbedtls_threading_mutex_t *mutex, in mbedtls_test_mutex_usage_error() argument
102 (void) mutex; in mbedtls_test_mutex_usage_error()
113 static void mbedtls_test_wrap_mutex_init(mbedtls_threading_mutex_t *mutex) in mbedtls_test_wrap_mutex_init() argument
115 mutex_functions.init(mutex); in mbedtls_test_wrap_mutex_init()
116 if (mutex->is_valid) { in mbedtls_test_wrap_mutex_init()
121 static void mbedtls_test_wrap_mutex_free(mbedtls_threading_mutex_t *mutex) in mbedtls_test_wrap_mutex_free() argument
123 switch (mutex->is_valid) { in mbedtls_test_wrap_mutex_free()
125 mbedtls_test_mutex_usage_error(mutex, "free without init or double free"); in mbedtls_test_wrap_mutex_free()
132 mbedtls_test_mutex_usage_error(mutex, "free without unlock"); in mbedtls_test_wrap_mutex_free()
135 mbedtls_test_mutex_usage_error(mutex, "corrupted state"); in mbedtls_test_wrap_mutex_free()
[all …]
/third_party/mbedtls/library/
Dthreading.c65 static void threading_mutex_init_pthread(mbedtls_threading_mutex_t *mutex) in threading_mutex_init_pthread() argument
67 if (mutex == NULL) { in threading_mutex_init_pthread()
77 mutex->is_valid = pthread_mutex_init(&mutex->mutex, NULL) == 0; in threading_mutex_init_pthread()
80 static void threading_mutex_free_pthread(mbedtls_threading_mutex_t *mutex) in threading_mutex_free_pthread() argument
82 if (mutex == NULL || !mutex->is_valid) { in threading_mutex_free_pthread()
86 (void) pthread_mutex_destroy(&mutex->mutex); in threading_mutex_free_pthread()
87 mutex->is_valid = 0; in threading_mutex_free_pthread()
90 static int threading_mutex_lock_pthread(mbedtls_threading_mutex_t *mutex) in threading_mutex_lock_pthread() argument
92 if (mutex == NULL || !mutex->is_valid) { in threading_mutex_lock_pthread()
96 if (pthread_mutex_lock(&mutex->mutex) != 0) { in threading_mutex_lock_pthread()
[all …]
/third_party/skia/third_party/externals/swiftshader/src/Common/
DMutexLock.hpp32 pthread_mutex_init(&mutex, NULL); in MutexLock()
37 pthread_mutex_destroy(&mutex); in ~MutexLock()
42 return pthread_mutex_trylock(&mutex) == 0; in attemptLock()
47 pthread_mutex_lock(&mutex); in lock()
52 pthread_mutex_unlock(&mutex); in unlock()
56 pthread_mutex_t mutex; member in sw::MutexLock
71 mutex = 0; in BackoffLock()
78 if(mutex.exchange(true) == false) in attemptLock()
153 mutex.store(false, std::memory_order_release); in unlock()
158 return mutex.load(std::memory_order_acquire); in isLocked()
[all …]
DRecursiveLock.hpp33 return mutex.try_lock(); in attemptLock()
38 mutex.lock(); in lock()
43 mutex.unlock(); in unlock()
46 std::recursive_mutex mutex; member in sw::RecursiveLock
53 explicit RecursiveLockGuard(sw::RecursiveLock &mutex) : mutex(&mutex) in RecursiveLockGuard() argument
55 mutex.lock(); in RecursiveLockGuard()
58 explicit RecursiveLockGuard(sw::RecursiveLock *mutex) : mutex(mutex) in RecursiveLockGuard() argument
60 if (mutex) mutex->lock(); in RecursiveLockGuard()
65 if (mutex) mutex->unlock(); in ~RecursiveLockGuard()
69 sw::RecursiveLock *mutex; member in RecursiveLockGuard
/third_party/musl/libc-test/src/functionalext/supplement/thread/
Dpthread_mutex_timedlock.c33 pthread_mutex_t mutex; in pthread_mutex_timedlock_0100() local
36 pthread_mutex_init(&mutex, &mutex_attr); in pthread_mutex_timedlock_0100()
38 int rev = pthread_mutex_timedlock(&mutex, &ts); in pthread_mutex_timedlock_0100()
41 pthread_mutex_unlock(&mutex); in pthread_mutex_timedlock_0100()
42 pthread_mutex_destroy(&mutex); in pthread_mutex_timedlock_0100()
55 pthread_mutex_t mutex; in pthread_mutex_timedlock_0200() local
59 pthread_mutex_init(&mutex, &mutex_attr); in pthread_mutex_timedlock_0200()
60 int rev = pthread_mutex_timedlock(&mutex, &ts); in pthread_mutex_timedlock_0200()
63 pthread_mutex_unlock(&mutex); in pthread_mutex_timedlock_0200()
64 pthread_mutex_destroy(&mutex); in pthread_mutex_timedlock_0200()
[all …]
Dmtx_timedlock.c35 mtx_t mutex; in mtx_timedlock_0100() local
37 ret = mtx_init(&mutex, mtx_timed); in mtx_timedlock_0100()
42 ret = mtx_timedlock(&mutex, &timeout); in mtx_timedlock_0100()
44 ret = mtx_unlock(&mutex); in mtx_timedlock_0100()
49 mtx_destroy(&mutex); in mtx_timedlock_0100()
59 mtx_t mutex; in mtx_timedlock_0200() local
64 ret = mtx_init(&mutex, mtx_timed); in mtx_timedlock_0200()
73 ret = mtx_lock(&mutex); in mtx_timedlock_0200()
74 ret = mtx_timedlock(&mutex, &timeout); in mtx_timedlock_0200()
76 ret = mtx_unlock(&mutex); in mtx_timedlock_0200()
[all …]
/third_party/libuv/test/
Dtest-mutexes.c29 static uv_mutex_t mutex; variable
39 uv_mutex_t mutex; in TEST_IMPL() local
42 r = uv_mutex_init(&mutex); in TEST_IMPL()
45 uv_mutex_lock(&mutex); in TEST_IMPL()
46 uv_mutex_unlock(&mutex); in TEST_IMPL()
47 uv_mutex_destroy(&mutex); in TEST_IMPL()
54 uv_mutex_t mutex; in TEST_IMPL() local
57 r = uv_mutex_init_recursive(&mutex); in TEST_IMPL()
60 uv_mutex_lock(&mutex); in TEST_IMPL()
61 uv_mutex_lock(&mutex); in TEST_IMPL()
[all …]
/third_party/skia/third_party/externals/microhttpd/src/include/
Dplatform_interface.h252 #define MHD_mutex_create_(mutex) \ argument
253 ((0 == pthread_mutex_init ((mutex), NULL)) ? MHD_YES : MHD_NO)
260 #define MHD_mutex_create_(mutex) \ argument
261 ((NULL != (mutex) && 0 != InitializeCriticalSectionAndSpinCount((mutex),2000)) ? MHD_YES : MHD_NO)
270 #define MHD_mutex_destroy_(mutex) \ argument
271 ((0 == pthread_mutex_destroy ((mutex))) ? MHD_YES : MHD_NO)
278 #define MHD_mutex_destroy_(mutex) \ argument
279 ((NULL != (mutex)) ? (DeleteCriticalSection(mutex), MHD_YES) : MHD_NO)
290 #define MHD_mutex_lock_(mutex) \ argument
291 ((0 == pthread_mutex_lock((mutex))) ? MHD_YES : MHD_NO)
[all …]
/third_party/vk-gl-cts/framework/delibs/dethread/
DdeThreadTest.c176 deMutex mutex = *((deMutex*)arg); in mutexTestThr1() local
178 deMutex_lock(mutex); in mutexTestThr1()
179 deMutex_unlock(mutex); in mutexTestThr1()
184 deMutex mutex; member
198 deMutex_lock(data->mutex); in mutexTestThr2()
202 deMutex_unlock(data->mutex); in mutexTestThr2()
213 deMutex_unlock(data->mutex); in mutexTestThr2()
218 deMutex_lock(data->mutex); in mutexTestThr2()
220 deMutex_unlock(data->mutex); in mutexTestThr2()
225 deMutex mutex = *((deMutex*)arg); in mutexTestThr3() local
[all …]
/third_party/vk-gl-cts/framework/delibs/dethread/win32/
DdeMutexWin32.c65 void deMutex_destroy (deMutex mutex) in deMutex_destroy() argument
67 DeleteCriticalSection((CRITICAL_SECTION*)mutex); in deMutex_destroy()
68 deFree((CRITICAL_SECTION*)mutex); in deMutex_destroy()
71 void deMutex_lock (deMutex mutex) in deMutex_lock() argument
73 EnterCriticalSection((CRITICAL_SECTION*)mutex); in deMutex_lock()
76 void deMutex_unlock (deMutex mutex) in deMutex_unlock() argument
78 LeaveCriticalSection((CRITICAL_SECTION*)mutex); in deMutex_unlock()
81 deBool deMutex_tryLock (deMutex mutex) in deMutex_tryLock() argument
83 return TryEnterCriticalSection((CRITICAL_SECTION*)mutex) == TRUE; in deMutex_tryLock()
101 void deMutex_destroy (deMutex mutex) in deMutex_destroy() argument
[all …]
/third_party/vk-gl-cts/framework/delibs/dethread/unix/
DdeMutexUnix.c40 pthread_mutex_t* mutex = deMalloc(sizeof(pthread_mutex_t)); in deMutex_create() local
42 if (!mutex) in deMutex_create()
47 deFree(mutex); in deMutex_create()
58 deFree(mutex); in deMutex_create()
69 deFree(mutex); in deMutex_create()
75 ret = pthread_mutex_init(mutex, &attr); in deMutex_create()
79 deFree(mutex); in deMutex_create()
85 return (deMutex)mutex; in deMutex_create()
88 void deMutex_destroy (deMutex mutex) in deMutex_destroy() argument
90 pthread_mutex_t* pMutex = (pthread_mutex_t*)mutex; in deMutex_destroy()
[all …]
/third_party/node/src/
Dnode_mutex.h86 inline explicit ScopedLock(const MutexBase& mutex);
101 inline explicit ScopedReadLock(const MutexBase& mutex);
158 static inline int mutex_init(MutexT* mutex) { in mutex_init()
159 return uv_mutex_init(mutex); in mutex_init()
174 static inline void cond_wait(CondT* cond, MutexT* mutex) { in cond_wait()
175 uv_cond_wait(cond, mutex); in cond_wait()
178 static inline void mutex_destroy(MutexT* mutex) { in mutex_destroy()
179 uv_mutex_destroy(mutex); in mutex_destroy()
182 static inline void mutex_lock(MutexT* mutex) { in mutex_lock()
183 uv_mutex_lock(mutex); in mutex_lock()
[all …]
/third_party/musl/Benchmark/musl/
Dlibc_pthread.cpp45 pthread_mutex_t mutex; in Bm_function_pthread_mutex_trylock_fast() local
46 pthread_mutex_init(&mutex, &mutexAttr); in Bm_function_pthread_mutex_trylock_fast()
49 pthread_mutex_trylock(&mutex); in Bm_function_pthread_mutex_trylock_fast()
50 pthread_mutex_unlock(&mutex); in Bm_function_pthread_mutex_trylock_fast()
60 pthread_mutex_t mutex; in Bm_function_pthread_mutex_trylock_errchk() local
61 pthread_mutex_init(&mutex, &mutexAttr); in Bm_function_pthread_mutex_trylock_errchk()
64 pthread_mutex_trylock(&mutex); in Bm_function_pthread_mutex_trylock_errchk()
65 pthread_mutex_unlock(&mutex); in Bm_function_pthread_mutex_trylock_errchk()
75 pthread_mutex_t mutex; in Bm_function_pthread_mutex_trylock_rec() local
76 pthread_mutex_init(&mutex, &mutexAttr); in Bm_function_pthread_mutex_trylock_rec()
[all …]
/third_party/skia/third_party/externals/swiftshader/third_party/llvm-subzero/lib/Support/
DMutex.cpp48 pthread_mutex_t* mutex = in MutexImpl() local
63 errorcode = pthread_mutex_init(mutex, &attr); in MutexImpl()
71 data_ = mutex; in MutexImpl()
77 pthread_mutex_t* mutex = static_cast<pthread_mutex_t*>(data_); in ~MutexImpl() local
78 assert(mutex != nullptr); in ~MutexImpl()
79 pthread_mutex_destroy(mutex); in ~MutexImpl()
80 free(mutex); in ~MutexImpl()
86 pthread_mutex_t* mutex = static_cast<pthread_mutex_t*>(data_); in acquire() local
87 assert(mutex != nullptr); in acquire()
89 int errorcode = pthread_mutex_lock(mutex); in acquire()
[all …]
/third_party/node/deps/v8/src/base/platform/
Dcondition-variable.cc76 void ConditionVariable::Wait(Mutex* mutex) { in Wait() argument
77 mutex->AssertHeldAndUnmark(); in Wait()
78 int result = pthread_cond_wait(&native_handle_, &mutex->native_handle()); in Wait()
81 mutex->AssertUnheldAndMark(); in Wait()
85 bool ConditionVariable::WaitFor(Mutex* mutex, const TimeDelta& rel_time) { in WaitFor() argument
88 mutex->AssertHeldAndUnmark(); in WaitFor()
96 &native_handle_, &mutex->native_handle(), &ts); in WaitFor()
113 &native_handle_, &mutex->native_handle(), &ts); in WaitFor()
115 mutex->AssertUnheldAndMark(); in WaitFor()
141 void ConditionVariable::Wait(Mutex* mutex) {
[all …]
/third_party/mesa3d/src/gallium/auxiliary/os/
Dos_thread.h45 #define pipe_mutex_assert_locked(mutex) \ argument
46 __pipe_mutex_assert_locked(&(mutex))
49 __pipe_mutex_assert_locked(mtx_t *mutex) in __pipe_mutex_assert_locked() argument
55 int ret = mtx_trylock(mutex); in __pipe_mutex_assert_locked()
58 mtx_unlock(mutex); in __pipe_mutex_assert_locked()
60 (void)mutex; in __pipe_mutex_assert_locked()
71 mtx_t mutex; member
80 (void) mtx_init(&sema->mutex, mtx_plain); in pipe_semaphore_init()
88 mtx_destroy(&sema->mutex); in pipe_semaphore_destroy()
96 mtx_lock(&sema->mutex); in pipe_semaphore_signal()
[all …]
/third_party/libuv/src/unix/
Dthread.c70 rc = uv_mutex_init(&b->mutex); in uv_barrier_init()
82 uv_mutex_destroy(&b->mutex); in uv_barrier_init()
97 uv_mutex_lock(&b->mutex); in uv_barrier_wait()
105 uv_cond_wait(&b->cond, &b->mutex); in uv_barrier_wait()
112 uv_mutex_unlock(&b->mutex); in uv_barrier_wait()
121 uv_mutex_lock(&b->mutex); in uv_barrier_destroy()
125 uv_cond_wait(&b->cond, &b->mutex); in uv_barrier_destroy()
130 uv_mutex_unlock(&b->mutex); in uv_barrier_destroy()
131 uv_mutex_destroy(&b->mutex); in uv_barrier_destroy()
302 int uv_mutex_init(uv_mutex_t* mutex) { in uv_mutex_init() argument
[all …]
/third_party/node/deps/uv/src/unix/
Dthread.c70 rc = uv_mutex_init(&b->mutex); in uv_barrier_init()
82 uv_mutex_destroy(&b->mutex); in uv_barrier_init()
97 uv_mutex_lock(&b->mutex); in uv_barrier_wait()
105 uv_cond_wait(&b->cond, &b->mutex); in uv_barrier_wait()
112 uv_mutex_unlock(&b->mutex); in uv_barrier_wait()
121 uv_mutex_lock(&b->mutex); in uv_barrier_destroy()
125 uv_cond_wait(&b->cond, &b->mutex); in uv_barrier_destroy()
130 uv_mutex_unlock(&b->mutex); in uv_barrier_destroy()
131 uv_mutex_destroy(&b->mutex); in uv_barrier_destroy()
302 int uv_mutex_init(uv_mutex_t* mutex) { in uv_mutex_init() argument
[all …]
/third_party/python/Python/
Dthread_nt.h55 FreeNonRecursiveMutex(PNRMUTEX mutex) in FreeNonRecursiveMutex() argument
57 if (mutex) { in FreeNonRecursiveMutex()
58 PyCOND_FINI(&mutex->cv); in FreeNonRecursiveMutex()
59 PyMUTEX_FINI(&mutex->cs); in FreeNonRecursiveMutex()
60 PyMem_RawFree(mutex); in FreeNonRecursiveMutex()
65 EnterNonRecursiveMutex(PNRMUTEX mutex, DWORD milliseconds) in EnterNonRecursiveMutex() argument
68 if (PyMUTEX_LOCK(&mutex->cs)) in EnterNonRecursiveMutex()
71 while (mutex->locked) { in EnterNonRecursiveMutex()
72 if (PyCOND_WAIT(&mutex->cv, &mutex->cs)) { in EnterNonRecursiveMutex()
85 while (mutex->locked) { in EnterNonRecursiveMutex()
[all …]
/third_party/icu/icu4c/source/common/
Dumutex.cpp47 std::mutex *initMutex;
61 initMutex->~mutex(); in umtx_cleanup()
73 initMutex = STATIC_NEW(std::mutex); in umtx_init()
80 std::mutex *UMutex::getMutex() { in getMutex()
81 std::mutex *retPtr = fMutex.load(std::memory_order_acquire); in getMutex()
84 std::lock_guard<std::mutex> guard(*initMutex); in getMutex()
87 fMutex = new(fStorage) std::mutex(); in getMutex()
102 (*m->fMutex).~mutex(); in cleanup()
112 umtx_lock(UMutex *mutex) { in umtx_lock() argument
113 if (mutex == nullptr) { in umtx_lock()
[all …]
/third_party/node/deps/icu-small/source/common/
Dumutex.cpp47 std::mutex *initMutex;
61 initMutex->~mutex(); in umtx_cleanup()
73 initMutex = STATIC_NEW(std::mutex); in umtx_init()
80 std::mutex *UMutex::getMutex() { in getMutex()
81 std::mutex *retPtr = fMutex.load(std::memory_order_acquire); in getMutex()
84 std::lock_guard<std::mutex> guard(*initMutex); in getMutex()
87 fMutex = new(fStorage) std::mutex(); in getMutex()
102 (*m->fMutex).~mutex(); in cleanup()
112 umtx_lock(UMutex *mutex) { in umtx_lock() argument
113 if (mutex == nullptr) { in umtx_lock()
[all …]
/third_party/ltp/include/
Dtst_safe_pthread.h71 pthread_mutex_t *mutex, const pthread_mutexattr_t *attr);
72 #define SAFE_PTHREAD_MUTEX_INIT(mutex, attr) \ argument
73 safe_pthread_mutex_init(__FILE__, __LINE__, (mutex), (attr))
76 pthread_mutex_t *mutex);
77 #define SAFE_PTHREAD_MUTEX_DESTROY(mutex) \ argument
78 safe_pthread_mutex_destroy(__FILE__, __LINE__, (mutex))
81 pthread_mutex_t *mutex);
82 #define SAFE_PTHREAD_MUTEX_LOCK(mutex) \ argument
83 safe_pthread_mutex_lock(__FILE__, __LINE__, (mutex))
87 pthread_mutex_t *mutex);
[all …]
/third_party/skia/third_party/externals/icu/source/common/
Dumutex.cpp47 std::mutex *initMutex;
61 initMutex->~mutex(); in umtx_cleanup()
73 initMutex = STATIC_NEW(std::mutex); in umtx_init()
80 std::mutex *UMutex::getMutex() { in getMutex()
81 std::mutex *retPtr = fMutex.load(std::memory_order_acquire); in getMutex()
84 std::lock_guard<std::mutex> guard(*initMutex); in getMutex()
87 fMutex = new(fStorage) std::mutex(); in getMutex()
102 (*m->fMutex).~mutex(); in cleanup()
112 umtx_lock(UMutex *mutex) { in umtx_lock() argument
113 if (mutex == nullptr) { in umtx_lock()
[all …]
/third_party/ffmpeg/libavutil/
Dthread.h65 static inline int strict_pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr) in strict_pthread_mutex_init() argument
68 ASSERT_PTHREAD_NORET(pthread_mutex_init, mutex, attr); in strict_pthread_mutex_init()
73 ASSERT_PTHREAD_NORET(pthread_mutex_init, mutex, &local_attr); in strict_pthread_mutex_init()
79 static inline int strict_pthread_mutex_destroy(pthread_mutex_t *mutex) in strict_pthread_mutex_destroy() argument
81 ASSERT_PTHREAD(pthread_mutex_destroy, mutex); in strict_pthread_mutex_destroy()
84 static inline int strict_pthread_mutex_lock(pthread_mutex_t *mutex) in strict_pthread_mutex_lock() argument
86 ASSERT_PTHREAD(pthread_mutex_lock, mutex); in strict_pthread_mutex_lock()
89 static inline int strict_pthread_mutex_unlock(pthread_mutex_t *mutex) in strict_pthread_mutex_unlock() argument
91 ASSERT_PTHREAD(pthread_mutex_unlock, mutex); in strict_pthread_mutex_unlock()
114 static inline int strict_pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) in strict_pthread_cond_wait() argument
[all …]
/third_party/skia/third_party/externals/swiftshader/third_party/marl/include/marl/
Dscheduler.h340 void start() EXCLUDES(work.mutex);
344 void stop() EXCLUDES(work.mutex);
351 EXCLUDES(work.mutex);
357 bool wait(const TimePoint* timeout) EXCLUDES(work.mutex);
362 void suspend(const TimePoint* timeout) REQUIRES(work.mutex);
365 void enqueue(Fiber* fiber) EXCLUDES(work.mutex);
368 void enqueue(Task&& task) EXCLUDES(work.mutex);
373 bool tryLock() EXCLUDES(work.mutex) TRY_ACQUIRE(true, work.mutex);
378 void enqueueAndUnlock(Task&& task) REQUIRES(work.mutex) RELEASE(work.mutex);
382 void runUntilShutdown() REQUIRES(work.mutex);
[all …]

12345678910>>...37