Home
last modified time | relevance | path

Searched full:mutex (Results 1 – 25 of 5639) sorted by relevance

12345678910>>...226

/external/curl/tests/data/
Dtest155422 -> Mutex lock
23 <- Mutex unlock
24 -> Mutex lock
25 <- Mutex unlock
26 -> Mutex lock
27 <- Mutex unlock
28 -> Mutex lock
29 <- Mutex unlock
30 -> Mutex lock
31 <- Mutex unlock
[all …]
/external/kotlinx.coroutines/kotlinx-coroutines-core/common/test/sync/
DMutexTest.kt14 val mutex = Mutex() in <lambda>() constant
18 mutex.lock() // suspends in <lambda>()
20 mutex.unlock() in <lambda>()
24 mutex.lock() // locked in <lambda>()
28 mutex.unlock() in <lambda>()
36 val mutex = Mutex() in tryLockTest() constant
37 assertFalse(mutex.isLocked) in tryLockTest()
38 assertTrue(mutex.tryLock()) in tryLockTest()
39 assertTrue(mutex.isLocked) in tryLockTest()
40 assertFalse(mutex.tryLock()) in tryLockTest()
[all …]
/external/guava/android/guava/src/com/google/common/collect/
DSynchronized.java48 * backing collection and the mutex are serializable.
50 * <p>If {@code null} is passed as the {@code mutex} parameter to any of this class's top-level
51 * methods or inner class constructors, the created object uses itself as the synchronization mutex.
74 final Object mutex; field in Synchronized.SynchronizedObject
76 SynchronizedObject(Object delegate, @CheckForNull Object mutex) { in SynchronizedObject() argument
78 this.mutex = (mutex == null) ? this : mutex; in SynchronizedObject()
89 synchronized (mutex) { in toString()
102 synchronized (mutex) { in writeObject()
113 Collection<E> collection, @CheckForNull Object mutex) { in collection() argument
114 return new SynchronizedCollection<E>(collection, mutex); in collection()
[all …]
/external/guava/guava/src/com/google/common/collect/
DSynchronized.java56 * backing collection and the mutex are serializable.
58 * <p>If {@code null} is passed as the {@code mutex} parameter to any of this class's top-level
59 * methods or inner class constructors, the created object uses itself as the synchronization mutex.
82 final Object mutex; field in Synchronized.SynchronizedObject
84 SynchronizedObject(Object delegate, @CheckForNull Object mutex) { in SynchronizedObject() argument
86 this.mutex = (mutex == null) ? this : mutex; in SynchronizedObject()
97 synchronized (mutex) { in toString()
110 synchronized (mutex) { in writeObject()
121 Collection<E> collection, @CheckForNull Object mutex) { in collection() argument
122 return new SynchronizedCollection<E>(collection, mutex); in collection()
[all …]
/external/sdv/vsomeip/third_party/boost/thread/test/
Dtest_lock_concept.cpp12 #include <boost/thread/mutex.hpp>
19 template<typename Mutex,typename Lock>
24 Mutex m; in operator ()()
32 template<typename Mutex,typename Lock>
35 Mutex m;
36 boost::mutex done_mutex;
49 boost::lock_guard<boost::mutex> lk(done_mutex); in locking_thread()
65 typedef test_initially_unlocked_if_other_thread_has_lock<Mutex,Lock> this_type; in operator ()()
72 boost::unique_lock<boost::mutex> lk(done_mutex); in operator ()()
90 template<typename Mutex,typename Lock>
[all …]
/external/pigweed/pw_sync/
Dmutex_facade_test.cc17 #include "pw_sync/mutex.h"
27 void pw_sync_Mutex_CallLock(pw_sync_Mutex* mutex);
28 bool pw_sync_Mutex_CallTryLock(pw_sync_Mutex* mutex);
29 void pw_sync_Mutex_CallUnlock(pw_sync_Mutex* mutex);
35 TEST(Mutex, LockUnlock) { in TEST() argument
36 Mutex mutex; in TEST() local
37 mutex.lock(); in TEST()
39 // EXPECT_FALSE(mutex.try_lock()); in TEST()
40 mutex.unlock(); in TEST()
43 Mutex static_mutex;
[all …]
/external/rust/crates/futures-util/src/lock/
Dmutex.rs6 use std::sync::{Arc, Mutex as StdMutex};
14 /// A futures-aware mutex.
18 /// This mutex provides no fairness guarantees. Tasks may not acquire the mutex
22 pub struct Mutex<T: ?Sized> { struct
28 impl<T: ?Sized> fmt::Debug for Mutex<T> { argument
31 f.debug_struct("Mutex") in fmt()
38 impl<T> From<T> for Mutex<T> { implementation
44 impl<T: Default> Default for Mutex<T> { implementation
74 impl<T> Mutex<T> { impl
75 /// Creates a new futures-aware mutex.
[all …]
/external/sdv/vsomeip/third_party/boost/thread/include/boost/thread/
Dlock_types.hpp33 template <typename Mutex>
36 template <typename Mutex>
39 template <typename Mutex>
44 template <typename Mutex>
98 template <typename Mutex>
102 Mutex* m;
106 explicit unique_lock(upgrade_lock<Mutex>&);
107 unique_lock& operator=(upgrade_lock<Mutex>& other);
109 typedef Mutex mutex_type;
121 explicit unique_lock(Mutex& m_) : in unique_lock()
[all …]
/external/cronet/third_party/apache-portable-runtime/src/include/
Dapr_proc_mutex.h53 /** Opaque structure representing a process mutex. */
59 * Create and initialize a mutex that can be used to synchronize processes.
60 * @param mutex the memory address where the newly created mutex will be
74 * @param pool the pool from which to allocate the mutex.
79 APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex,
85 * Re-open a mutex in a child process.
86 * @param mutex The newly re-opened mutex structure.
87 * @param fname A file name to use if the mutex mechanism requires one. This
88 * argument should always be provided. The mutex code itself will
95 APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex,
[all …]
Dapr_global_mutex.h45 /** Opaque global mutex structure. */
51 * Create and initialize a mutex that can be used to synchronize both
56 * @param mutex the memory address where the newly created mutex will be
70 * @param pool the pool from which to allocate the mutex.
74 APR_DECLARE(apr_status_t) apr_global_mutex_create(apr_global_mutex_t **mutex,
80 * Re-open a mutex in a child process.
81 * @param mutex The newly re-opened mutex structure.
82 * @param fname A file name to use if the mutex mechanism requires one. This
83 * argument should always be provided. The mutex code itself will
91 apr_global_mutex_t **mutex,
[all …]
/external/cronet/third_party/apache-portable-runtime/src/test/
Dtestcond.c37 apr_thread_mutex_t *mutex; member
52 apr_thread_mutex_t *mutex = NULL; in lost_signal() local
54 rv = apr_thread_mutex_create(&mutex, APR_THREAD_MUTEX_DEFAULT, p); in lost_signal()
56 ABTS_PTR_NOTNULL(tc, mutex); in lost_signal()
65 rv = apr_thread_mutex_lock(mutex); in lost_signal()
68 rv = apr_thread_cond_timedwait(cond, mutex, 10000); in lost_signal()
71 rv = apr_thread_mutex_unlock(mutex); in lost_signal()
77 rv = apr_thread_mutex_lock(mutex); in lost_signal()
80 rv = apr_thread_cond_timedwait(cond, mutex, 10000); in lost_signal()
83 rv = apr_thread_mutex_unlock(mutex); in lost_signal()
[all …]
/external/rust/crates/grpcio-sys/grpc/third_party/re2/util/
Dmutex.h9 * A simple mutex wrapper, supporting locks and read-write locks.
42 class Mutex {
44 inline Mutex();
45 inline ~Mutex();
53 inline void ReaderUnlock(); // Release a read share of this Mutex
60 // Catch the error of writing Mutex when intending MutexLock.
61 Mutex(Mutex *ignored);
63 Mutex(const Mutex&) = delete;
64 Mutex& operator=(const Mutex&) = delete;
69 Mutex::Mutex() : mutex_(SRWLOCK_INIT) { } in Mutex() function
[all …]
/external/gflags/src/
Dmutex.h32 // A simple mutex wrapper, supporting locks and read-write locks.
40 // problems when we have multiple versions of Mutex in each shared object.
64 // function that tries to acquire this mutex -- but that all happens
65 // before this mutex's constructor has run. (This can happen even if
66 // the mutex and the function that uses the mutex are in the same .cc
67 // file.) Basically, because Mutex does non-trivial work in its
71 // The solution used here is to pair the actual mutex primitive with a
72 // bool that is set to true when the mutex is dynamically initialized.
73 // (Before that it's false.) Then we modify all mutex routines to
75 // it to true (which happens after the Mutex constructor has run.)
[all …]
/external/XNNPACK/src/
Dmutex.c11 #include <xnnpack/mutex.h>
24 enum xnn_status xnn_mutex_init(struct xnn_mutex* mutex) { in xnn_mutex_init() argument
26 mutex->handle = CreateMutexW( in xnn_mutex_init()
30 if (mutex->handle == NULL) { in xnn_mutex_init()
31 xnn_log_error("failed to initialize mutex, error code: %" PRIu32, (uint32_t) GetLastError()); in xnn_mutex_init()
35 mutex->semaphore = dispatch_semaphore_create(1); in xnn_mutex_init()
36 if (mutex->semaphore == NULL) { in xnn_mutex_init()
37 xnn_log_error("failed to initialize mutex"); in xnn_mutex_init()
41 const int ret = pthread_mutex_init(&mutex->mutex, NULL); in xnn_mutex_init()
43 xnn_log_error("failed to initialize mutex, error code: %d", ret); in xnn_mutex_init()
[all …]
/external/openthread/third_party/mbedtls/repo/tests/src/
Dthreading_helpers.c1 /** Mutex usage verification framework. */
15 /** Mutex usage verification framework.
17 * The mutex usage verification code below aims to detect bad usage of
18 * Mbed TLS's mutex abstraction layer at runtime. Note that this is solely
19 * about the use of the mutex itself, not about checking whether the mutex
22 * The normal usage of a mutex is:
38 * An attempt to use an uninitialized mutex cannot be detected in general
41 * All-bits-zero is the state of a freed mutex, which is distinct from an
42 * initialized mutex, so attempting to use zero-initialized memory as a mutex
47 * means that a mutex is not being freed somewhere, which is a memory leak
[all …]
/external/mbedtls/tests/src/
Dthreading_helpers.c1 /** Mutex usage verification framework. */
15 /** Mutex usage verification framework.
17 * The mutex usage verification code below aims to detect bad usage of
18 * Mbed TLS's mutex abstraction layer at runtime. Note that this is solely
19 * about the use of the mutex itself, not about checking whether the mutex
22 * The normal usage of a mutex is:
38 * An attempt to use an uninitialized mutex cannot be detected in general
41 * All-bits-zero is the state of a freed mutex, which is distinct from an
42 * initialized mutex, so attempting to use zero-initialized memory as a mutex
47 * means that a mutex is not being freed somewhere, which is a memory leak
[all …]
/external/cronet/third_party/apache-portable-runtime/src/locks/unix/
Dproc_mutex.c23 APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex) in apr_proc_mutex_destroy() argument
25 return apr_pool_cleanup_run(mutex->pool, mutex, apr_proc_mutex_cleanup); in apr_proc_mutex_destroy()
30 static apr_status_t proc_mutex_no_child_init(apr_proc_mutex_t **mutex, in proc_mutex_no_child_init() argument
46 apr_proc_mutex_t *mutex = mutex_; in proc_mutex_posix_cleanup() local
48 if (sem_close(mutex->psem_interproc) < 0) { in proc_mutex_posix_cleanup()
145 static apr_status_t proc_mutex_posix_acquire(apr_proc_mutex_t *mutex) in proc_mutex_posix_acquire() argument
150 rc = sem_wait(mutex->psem_interproc); in proc_mutex_posix_acquire()
155 mutex->curr_locked = 1; in proc_mutex_posix_acquire()
159 static apr_status_t proc_mutex_posix_tryacquire(apr_proc_mutex_t *mutex) in proc_mutex_posix_tryacquire() argument
164 rc = sem_trywait(mutex->psem_interproc); in proc_mutex_posix_tryacquire()
[all …]
/external/clang/test/SemaCXX/
Dwarn-thread-safety-analysis.cpp30 class LOCKABLE Mutex { class
40 const Mutex& operator!() const { return *this; } in operator !()
48 MutexLock(Mutex *mu) EXCLUSIVE_LOCK_FUNCTION(mu);
49 MutexLock(Mutex *mu, bool adopt) EXCLUSIVE_LOCKS_REQUIRED(mu);
55 ReaderMutexLock(Mutex *mu) SHARED_LOCK_FUNCTION(mu);
56 ReaderMutexLock(Mutex *mu, bool adopt) SHARED_LOCKS_REQUIRED(mu);
62 ReleasableMutexLock(Mutex *mu) EXCLUSIVE_LOCK_FUNCTION(mu);
70 DoubleMutexLock(Mutex *mu1, Mutex *mu2)
141 Mutex sls_mu;
143 Mutex sls_mu2 __attribute__((acquired_after(sls_mu)));
[all …]
/external/rust/crates/lock_api/src/
Dmutex.rs27 /// Basic operations for a mutex.
29 /// Types implementing this trait can be used by `Mutex` to form a safe and
30 /// fully-functioning mutex type.
34 /// Implementations of this trait must ensure that the mutex is actually
35 /// exclusive: a lock can't be acquired while the mutex is already locked.
37 /// Initial value for an unlocked mutex.
47 /// Acquires this mutex, blocking the current thread until it is able to do so.
50 /// Attempts to acquire this mutex without blocking. Returns `true`
54 /// Unlocks this mutex.
58 /// This method may only be called if the mutex is held in the current context, i.e. it must
[all …]
/external/regex-re2/util/
Dmutex.h9 * A simple mutex wrapper, supporting locks and read-write locks.
28 #include <mutex>
29 typedef std::mutex MutexType;
34 class Mutex {
36 inline Mutex();
37 inline ~Mutex();
45 inline void ReaderUnlock(); // Release a read share of this Mutex
52 // Catch the error of writing Mutex when intending MutexLock.
53 Mutex(Mutex *ignored);
55 Mutex(const Mutex&) = delete;
[all …]
/external/webrtc/third_party/abseil-cpp/absl/synchronization/
Dmutex.h16 // mutex.h
19 // This header file defines a `Mutex` -- a mutually exclusive lock -- and the
21 // shared resources. A mutex is used to prevent multiple threads from accessing
24 // Unlike a `std::mutex`, the Abseil `Mutex` provides the following additional
26 // * Conditional predicates intrinsic to the `Mutex` object
32 // MutexLock - An RAII wrapper to acquire and release a `Mutex` for exclusive/
36 // - An RAII wrapper to acquire and release a `Mutex` for shared/read
43 // In addition to simple mutex locks, this file also defines ways to perform
47 // depends on state protected by the `Mutex` to become true.
54 // Mutexes and mutex behavior can be quite complicated. The information within
[all …]
/external/tensorflow/third_party/absl/abseil-cpp/absl/synchronization/
Dmutex.h16 // mutex.h
19 // This header file defines a `Mutex` -- a mutually exclusive lock -- and the
21 // shared resources. A mutex is used to prevent multiple threads from accessing
24 // Unlike a `std::mutex`, the Abseil `Mutex` provides the following additional
26 // * Conditional predicates intrinsic to the `Mutex` object
32 // MutexLock - An RAII wrapper to acquire and release a `Mutex` for exclusive/
36 // - An RAII wrapper to acquire and release a `Mutex` for shared/read
43 // In addition to simple mutex locks, this file also defines ways to perform
47 // depends on state protected by the `Mutex` to become true.
54 // Mutexes and mutex behavior can be quite complicated. The information within
[all …]
/external/openscreen/third_party/abseil/src/absl/synchronization/
Dmutex.h16 // mutex.h
19 // This header file defines a `Mutex` -- a mutually exclusive lock -- and the
21 // shared resources. A mutex is used to prevent multiple threads from accessing
24 // Unlike a `std::mutex`, the Abseil `Mutex` provides the following additional
26 // * Conditional predicates intrinsic to the `Mutex` object
32 // MutexLock - An RAII wrapper to acquire and release a `Mutex` for exclusive/
36 // - An RAII wrapper to acquire and release a `Mutex` for shared/read
43 // In addition to simple mutex locks, this file also defines ways to perform
47 // depends on state protected by the `Mutex` to become true.
54 // Mutexes and mutex behavior can be quite complicated. The information within
[all …]
/external/angle/third_party/abseil-cpp/absl/synchronization/
Dmutex.h16 // mutex.h
19 // This header file defines a `Mutex` -- a mutually exclusive lock -- and the
21 // shared resources. A mutex is used to prevent multiple threads from accessing
24 // Unlike a `std::mutex`, the Abseil `Mutex` provides the following additional
26 // * Conditional predicates intrinsic to the `Mutex` object
32 // MutexLock - An RAII wrapper to acquire and release a `Mutex` for exclusive/
36 // - An RAII wrapper to acquire and release a `Mutex` for shared/read
43 // In addition to simple mutex locks, this file also defines ways to perform
47 // depends on state protected by the `Mutex` to become true.
54 // Mutexes and mutex behavior can be quite complicated. The information within
[all …]
/external/abseil-cpp/absl/synchronization/
Dmutex.h16 // mutex.h
19 // This header file defines a `Mutex` -- a mutually exclusive lock -- and the
21 // shared resources. A mutex is used to prevent multiple threads from accessing
24 // Unlike a `std::mutex`, the Abseil `Mutex` provides the following additional
26 // * Conditional predicates intrinsic to the `Mutex` object
32 // MutexLock - An RAII wrapper to acquire and release a `Mutex` for exclusive/
36 // - An RAII wrapper to acquire and release a `Mutex` for shared/read
43 // In addition to simple mutex locks, this file also defines ways to perform
47 // depends on state protected by the `Mutex` to become true.
54 // Mutexes and mutex behavior can be quite complicated. The information within
[all …]

12345678910>>...226