Home
last modified time | relevance | path

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

12345678910>>...74

/third_party/flutter/skia/third_party/externals/sdl/src/thread/generic/
DSDL_sysmutex.c40 SDL_mutex *mutex; in SDL_CreateMutex() local
43 mutex = (SDL_mutex *) SDL_malloc(sizeof(*mutex)); in SDL_CreateMutex()
44 if (mutex) { in SDL_CreateMutex()
46 mutex->sem = SDL_CreateSemaphore(1); in SDL_CreateMutex()
47 mutex->recursive = 0; in SDL_CreateMutex()
48 mutex->owner = 0; in SDL_CreateMutex()
49 if (!mutex->sem) { in SDL_CreateMutex()
50 SDL_free(mutex); in SDL_CreateMutex()
51 mutex = NULL; in SDL_CreateMutex()
56 return mutex; in SDL_CreateMutex()
[all …]
/third_party/gettext/gettext-runtime/intl/
Dwindows-recmutex.c28 glwthread_recmutex_init (glwthread_recmutex_t *mutex) in glwthread_recmutex_init() argument
30 mutex->owner = 0; in glwthread_recmutex_init()
31 mutex->depth = 0; in glwthread_recmutex_init()
32 InitializeCriticalSection (&mutex->lock); in glwthread_recmutex_init()
33 mutex->guard.done = 1; in glwthread_recmutex_init()
37 glwthread_recmutex_lock (glwthread_recmutex_t *mutex) in glwthread_recmutex_lock() argument
39 if (!mutex->guard.done) in glwthread_recmutex_lock()
41 if (InterlockedIncrement (&mutex->guard.started) == 0) in glwthread_recmutex_lock()
43 glwthread_recmutex_init (mutex); in glwthread_recmutex_lock()
47 InterlockedDecrement (&mutex->guard.started); in glwthread_recmutex_lock()
[all …]
Dwindows-mutex.c28 glwthread_mutex_init (glwthread_mutex_t *mutex) in glwthread_mutex_init() argument
30 InitializeCriticalSection (&mutex->lock); in glwthread_mutex_init()
31 mutex->guard.done = 1; in glwthread_mutex_init()
35 glwthread_mutex_lock (glwthread_mutex_t *mutex) in glwthread_mutex_lock() argument
37 if (!mutex->guard.done) in glwthread_mutex_lock()
39 if (InterlockedIncrement (&mutex->guard.started) == 0) in glwthread_mutex_lock()
41 glwthread_mutex_init (mutex); in glwthread_mutex_lock()
45 InterlockedDecrement (&mutex->guard.started); in glwthread_mutex_lock()
48 while (!mutex->guard.done) in glwthread_mutex_lock()
52 EnterCriticalSection (&mutex->lock); in glwthread_mutex_lock()
[all …]
/third_party/flutter/skia/third_party/externals/sdl/src/thread/pthread/
DSDL_sysmutex.c48 SDL_mutex *mutex; in SDL_CreateMutex() local
52 mutex = (SDL_mutex *) SDL_calloc(1, sizeof(*mutex)); in SDL_CreateMutex()
53 if (mutex) { in SDL_CreateMutex()
62 if (pthread_mutex_init(&mutex->id, &attr) != 0) { in SDL_CreateMutex()
64 SDL_free(mutex); in SDL_CreateMutex()
65 mutex = NULL; in SDL_CreateMutex()
70 return (mutex); in SDL_CreateMutex()
74 SDL_DestroyMutex(SDL_mutex * mutex) in SDL_DestroyMutex() argument
76 if (mutex) { in SDL_DestroyMutex()
77 pthread_mutex_destroy(&mutex->id); in SDL_DestroyMutex()
[all …]
/third_party/flutter/skia/third_party/externals/sdl/src/thread/psp/
DSDL_sysmutex.c42 SDL_mutex *mutex; in SDL_CreateMutex() local
45 mutex = (SDL_mutex *) SDL_malloc(sizeof(*mutex)); in SDL_CreateMutex()
46 if (mutex) { in SDL_CreateMutex()
48 mutex->sem = SDL_CreateSemaphore(1); in SDL_CreateMutex()
49 mutex->recursive = 0; in SDL_CreateMutex()
50 mutex->owner = 0; in SDL_CreateMutex()
51 if (!mutex->sem) { in SDL_CreateMutex()
52 SDL_free(mutex); in SDL_CreateMutex()
53 mutex = NULL; in SDL_CreateMutex()
58 return mutex; in SDL_CreateMutex()
[all …]
/third_party/glib/glib/deprecated/
Dgthread-deprecated.c471 g_static_mutex_init (GStaticMutex *mutex) in g_static_mutex_init() argument
475 g_return_if_fail (mutex); in g_static_mutex_init()
477 *mutex = init_mutex; in g_static_mutex_init()
510 g_static_mutex_get_mutex_impl (GStaticMutex* mutex) in g_static_mutex_get_mutex_impl() argument
517 result = g_atomic_pointer_get (&mutex->mutex); in g_static_mutex_get_mutex_impl()
523 result = mutex->mutex; in g_static_mutex_get_mutex_impl()
527 g_atomic_pointer_set (&mutex->mutex, result); in g_static_mutex_get_mutex_impl()
590 g_static_mutex_free (GStaticMutex* mutex) in g_static_mutex_free() argument
594 g_return_if_fail (mutex); in g_static_mutex_free()
601 runtime_mutex = ((GMutex**)mutex); in g_static_mutex_free()
[all …]
/third_party/mbedtls/tests/src/
Dthreading_helpers.c101 static void mbedtls_test_mutex_usage_error( mbedtls_threading_mutex_t *mutex, in mbedtls_test_mutex_usage_error() argument
104 (void) mutex; in mbedtls_test_mutex_usage_error()
114 static void mbedtls_test_wrap_mutex_init( mbedtls_threading_mutex_t *mutex ) in mbedtls_test_wrap_mutex_init() argument
116 mutex_functions.init( mutex ); in mbedtls_test_wrap_mutex_init()
117 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()
126 mbedtls_test_mutex_usage_error( mutex, "free without init or double free" ); in mbedtls_test_wrap_mutex_free()
133 mbedtls_test_mutex_usage_error( mutex, "free without unlock" ); in mbedtls_test_wrap_mutex_free()
136 mbedtls_test_mutex_usage_error( mutex, "corrupted state" ); in mbedtls_test_wrap_mutex_free()
[all …]
/third_party/flutter/skia/third_party/externals/sdl/src/thread/windows/
DSDL_sysmutex.c41 SDL_mutex *mutex; in SDL_CreateMutex() local
44 mutex = (SDL_mutex *) SDL_malloc(sizeof(*mutex)); in SDL_CreateMutex()
45 if (mutex) { in SDL_CreateMutex()
49 InitializeCriticalSectionEx(&mutex->cs, 2000, 0); in SDL_CreateMutex()
51 InitializeCriticalSectionAndSpinCount(&mutex->cs, 2000); in SDL_CreateMutex()
56 return (mutex); in SDL_CreateMutex()
61 SDL_DestroyMutex(SDL_mutex * mutex) in SDL_DestroyMutex() argument
63 if (mutex) { in SDL_DestroyMutex()
64 DeleteCriticalSection(&mutex->cs); in SDL_DestroyMutex()
65 SDL_free(mutex); in SDL_DestroyMutex()
[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()
76 mutex->is_valid = pthread_mutex_init( &mutex->mutex, NULL ) == 0; in threading_mutex_init_pthread()
79 static void threading_mutex_free_pthread( mbedtls_threading_mutex_t *mutex ) in threading_mutex_free_pthread() argument
81 if( mutex == NULL || !mutex->is_valid ) in threading_mutex_free_pthread()
84 (void) pthread_mutex_destroy( &mutex->mutex ); in threading_mutex_free_pthread()
85 mutex->is_valid = 0; in threading_mutex_free_pthread()
88 static int threading_mutex_lock_pthread( mbedtls_threading_mutex_t *mutex ) in threading_mutex_lock_pthread() argument
90 if( mutex == NULL || ! mutex->is_valid ) in threading_mutex_lock_pthread()
93 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 …]
/third_party/boost/boost/thread/concurrent_queues/
Dsync_bounded_queue.hpp91 mutable mutex mtx_;
107 inline bool empty(unique_lock<mutex>& ) const BOOST_NOEXCEPT in empty()
111 inline bool empty(lock_guard<mutex>& ) const BOOST_NOEXCEPT in empty()
115 inline bool full(unique_lock<mutex>& ) const BOOST_NOEXCEPT in full()
119 inline bool full(lock_guard<mutex>& ) const BOOST_NOEXCEPT in full()
123 inline size_type capacity(lock_guard<mutex>& ) const BOOST_NOEXCEPT in capacity()
127 inline size_type size(lock_guard<mutex>& lk) const BOOST_NOEXCEPT in size()
133 inline void throw_if_closed(unique_lock<mutex>&);
134 inline bool closed(unique_lock<mutex>&) const;
137 inline bool try_pull(value_type& x, unique_lock<mutex>& lk);
[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/libusb/libusb/os/
Dthreads_posix.h30 static inline void usbi_mutex_static_lock(usbi_mutex_static_t *mutex) in usbi_mutex_static_lock() argument
32 PTHREAD_CHECK(pthread_mutex_lock(mutex)); in usbi_mutex_static_lock()
34 static inline void usbi_mutex_static_unlock(usbi_mutex_static_t *mutex) in usbi_mutex_static_unlock() argument
36 PTHREAD_CHECK(pthread_mutex_unlock(mutex)); in usbi_mutex_static_unlock()
40 static inline void usbi_mutex_init(usbi_mutex_t *mutex) in usbi_mutex_init() argument
42 PTHREAD_CHECK(pthread_mutex_init(mutex, NULL)); in usbi_mutex_init()
44 static inline void usbi_mutex_lock(usbi_mutex_t *mutex) in usbi_mutex_lock() argument
46 PTHREAD_CHECK(pthread_mutex_lock(mutex)); in usbi_mutex_lock()
48 static inline void usbi_mutex_unlock(usbi_mutex_t *mutex) in usbi_mutex_unlock() argument
50 PTHREAD_CHECK(pthread_mutex_unlock(mutex)); in usbi_mutex_unlock()
[all …]
Dthreads_windows.h28 static inline void usbi_mutex_static_lock(usbi_mutex_static_t *mutex) in usbi_mutex_static_lock() argument
30 while (InterlockedExchange(mutex, 1L) == 1L) in usbi_mutex_static_lock()
33 static inline void usbi_mutex_static_unlock(usbi_mutex_static_t *mutex) in usbi_mutex_static_unlock() argument
35 InterlockedExchange(mutex, 0L); in usbi_mutex_static_unlock()
39 static inline void usbi_mutex_init(usbi_mutex_t *mutex) in usbi_mutex_init() argument
41 InitializeCriticalSection(mutex); in usbi_mutex_init()
43 static inline void usbi_mutex_lock(usbi_mutex_t *mutex) in usbi_mutex_lock() argument
45 EnterCriticalSection(mutex); in usbi_mutex_lock()
47 static inline void usbi_mutex_unlock(usbi_mutex_t *mutex) in usbi_mutex_unlock() argument
49 LeaveCriticalSection(mutex); in usbi_mutex_unlock()
[all …]
/third_party/boost/boost/thread/concurrent_queues/detail/
Dsync_queue_base.hpp60 lock_guard<mutex> lk(mtx_); in underlying_queue()
65 mutable mutex mtx_;
70 inline bool empty(unique_lock<mutex>& ) const BOOST_NOEXCEPT in empty()
74 inline bool empty(lock_guard<mutex>& ) const BOOST_NOEXCEPT in empty()
79 inline size_type size(lock_guard<mutex>& ) const BOOST_NOEXCEPT in size()
83 inline bool closed(unique_lock<mutex>& lk) const;
84 inline bool closed(lock_guard<mutex>& lk) const;
86 inline void throw_if_closed(unique_lock<mutex>&);
87 inline void throw_if_closed(lock_guard<mutex>&);
89 inline bool not_empty_or_closed(unique_lock<mutex>& ) const;
[all …]
Dsync_deque_base.hpp60 lock_guard<mutex> lk(mtx_); in underlying_queue()
65 mutable mutex mtx_;
70 inline bool empty(unique_lock<mutex>& ) const BOOST_NOEXCEPT in empty()
74 inline bool empty(lock_guard<mutex>& ) const BOOST_NOEXCEPT in empty()
79 inline size_type size(lock_guard<mutex>& ) const BOOST_NOEXCEPT in size()
83 inline bool closed(unique_lock<mutex>& lk) const;
84 inline bool closed(lock_guard<mutex>& lk) const;
86 inline void throw_if_closed(unique_lock<mutex>&);
87 inline void throw_if_closed(lock_guard<mutex>&);
89 inline bool not_empty_or_closed(unique_lock<mutex>& ) const;
[all …]
/third_party/flutter/skia/third_party/externals/sdl/src/thread/stdcpp/
DSDL_sysmutex.cpp42 SDL_mutex * mutex = new SDL_mutex; in SDL_CreateMutex() local
43 return mutex; in SDL_CreateMutex()
56 SDL_DestroyMutex(SDL_mutex * mutex) in SDL_DestroyMutex() argument
58 if (mutex) { in SDL_DestroyMutex()
59 delete mutex; in SDL_DestroyMutex()
66 SDL_mutexP(SDL_mutex * mutex) in SDL_mutexP() argument
68 if (mutex == NULL) { in SDL_mutexP()
74 mutex->cpp_mutex.lock(); in SDL_mutexP()
84 SDL_TryLockMutex(SDL_mutex * mutex) in SDL_TryLockMutex() argument
87 if (mutex == NULL) { in SDL_TryLockMutex()
[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/boost/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/
Dmove_ctor_pass.cpp26 boost::mutex m;
31 boost::unique_lock<boost::mutex> lk0(m); in main()
32 boost::unique_lock<boost::mutex> lk( (boost::move(lk0))); in main()
33 BOOST_TEST(lk.mutex() == &m); in main()
35 BOOST_TEST(lk0.mutex() == 0); in main()
39 …boost::unique_lock<boost::mutex> lk( (BOOST_THREAD_MAKE_RV_REF(boost::unique_lock<boost::mutex>(m)… in main()
40 BOOST_TEST(lk.mutex() == &m); in main()
44 boost::unique_lock<boost::mutex> lk0(m, boost::defer_lock); in main()
45 boost::unique_lock<boost::mutex> lk( (boost::move(lk0))); in main()
46 BOOST_TEST(lk.mutex() == &m); in main()
[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/glib/glib/tests/
Dmutex.c35 GMutex mutex; in test_mutex1() local
37 g_mutex_init (&mutex); in test_mutex1()
38 g_mutex_lock (&mutex); in test_mutex1()
39 g_mutex_unlock (&mutex); in test_mutex1()
40 g_mutex_lock (&mutex); in test_mutex1()
41 g_mutex_unlock (&mutex); in test_mutex1()
42 g_mutex_clear (&mutex); in test_mutex1()
48 static GMutex mutex; in test_mutex2() local
50 g_mutex_lock (&mutex); in test_mutex2()
51 g_mutex_unlock (&mutex); in test_mutex2()
[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/boost/libs/thread/test/
Dshared_mutex_locking_thread.hpp23 boost::mutex& unblocked_count_mutex;
24 boost::mutex& finish_mutex;
28 boost::mutex& unblocked_count_mutex_, in locking_thread()
30 boost::mutex& finish_mutex_, in locking_thread()
53 boost::unique_lock<boost::mutex> ublock(unblocked_count_mutex); in operator ()()
64 boost::unique_lock<boost::mutex> finish_lock(finish_mutex); in operator ()()
66 boost::unique_lock<boost::mutex> ublock(unblocked_count_mutex); in operator ()()
77 boost::mutex& finish_mutex;
78 boost::mutex& unblocked_mutex;
85 boost::mutex& finish_mutex_, in simple_writing_thread()
[all …]

12345678910>>...74