/external/clang/test/Modules/Inputs/thread-safety/ |
a.h | 1 struct __attribute__((lockable)) mutex { struct
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/ |
2-1.c | 9 * a destroyed mutex object can be reinitialized using pthread_mutex_init() 19 pthread_mutex_t mutex; local 21 /* Initialize a mutex attributes object */ 22 if (pthread_mutex_init(&mutex, NULL) != 0) { 23 fprintf(stderr, "Cannot initialize mutex object\n"); 27 /* Destroy the mutex attributes object */ 28 if (pthread_mutex_destroy(&mutex) != 0) { 29 fprintf(stderr, "Cannot destroy the mutex object\n"); 33 /* Initialize the mutex attributes object again. This shouldn't result in an error. */ 34 if (pthread_mutex_init(&mutex, NULL) != 0) [all...] |
3-1.c | 20 pthread_mutex_t mutex; local 23 /* Initialize a mutex object */ 24 if ((rc = pthread_mutex_init(&mutex, NULL)) != 0) { 25 fprintf(stderr, "Fail to initialize mutex, rc=%d\n", rc); 29 if ((rc = pthread_mutex_destroy(&mutex)) == 0) { 37 "Detected an attempt to destroy a mutex in use\n"); 39 fprintf(stderr, "The value specified by 'mutex' is invalid\n");
|
5-1.c | 8 * It shall be safe to destroy an initialized mutex that is unlocked. 16 pthread_mutex_t mutex; variable 22 /* Initialize mutex with the default mutex attributes */ 23 if ((rc = pthread_mutex_init(&mutex, NULL)) != 0) { 24 fprintf(stderr, "Fail to initialize mutex, rc=%d\n", rc); 28 /* Lock mutex */ 29 if ((rc = pthread_mutex_lock(&mutex)) != 0) { 35 if ((rc = pthread_mutex_unlock(&mutex)) != 0) { 39 /* Destroy mutex after it is unlocked * [all...] |
/external/valgrind/memcheck/tests/darwin/ |
pth-supp.c | 6 pthread_rwlock_t mutex; local 7 pthread_rwlock_init(&mutex, NULL);
|
/external/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/ |
try_lock_until.pass.cpp | 15 // template <class Mutex> class shared_lock; 27 struct mutex struct 40 mutex m; 45 std::shared_lock<mutex> lk(m, std::defer_lock);
|
/external/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/ |
try_lock_until.pass.cpp | 12 // <mutex> 14 // template <class Mutex> class unique_lock; 19 #include <mutex> 26 struct mutex struct 39 mutex m; 44 std::unique_lock<mutex> lk(m, std::defer_lock);
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/ |
3-1.c | 7 * The protocol attribute of mutex is PTHREAD_PRIO_NONE. 13 * 1. Initialize a mutex via pthread_mutex_init. 14 * 2. Do not modify the mutex. 36 pthread_mutex_t mutex; local 44 /* Initialize a mutex object */ 45 error = pthread_mutex_init(&mutex, NULL); 51 /* Get the prioceiling of the mutex. */ 52 error = pthread_mutex_getprioceiling(&mutex, &prioceiling); 64 (void)pthread_mutex_destroy(&mutex);
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/ |
2-1.c | 9 * Upon successful initialization, the state of the mutex becomes 21 pthread_mutex_t mutex; local 24 /* Initialize a mutex object */ 25 if ((rc = pthread_mutex_init(&mutex, NULL)) != 0) { 26 fprintf(stderr, "Fail to initialize mutex, rc=%d\n", rc); 31 /* Acquire the mutex object using pthread_mutex_lock */ 32 if ((rc = pthread_mutex_lock(&mutex)) != 0) { 33 fprintf(stderr, "Fail to lock the mutex, rc=%d\n", rc); 37 fprintf(stderr, "Main: hold the mutex for a while\n"); 40 /* Release the mutex object using pthread_mutex_unlock * [all...] |
4-1.c | 21 pthread_mutex_t mutex; local 24 /* Initialize a mutex attributes object */ 31 /* Initialize a mutex object with the default mutex attributes */ 32 if ((rc = pthread_mutex_init(&mutex, &mta)) == 0) { 40 "Insufficient memory to initialize the mutex\n"); 44 "Lack of the necessary resources to initilize the mutex\n"); 51 "Detected an attemp to reinitilize a previously initilized mutex\n");
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/ |
2-1.c | 20 pthread_mutex_t mutex; local 23 /* Initialize a mutex object with the default mutex attributes */ 24 if ((rc = pthread_mutex_init(&mutex, NULL)) != 0) { 29 /* Lock the mutex using pthread_mutex_lock() */ 30 if ((rc = pthread_mutex_lock(&mutex)) == 0) { 31 pthread_mutex_unlock(&mutex); 38 fprintf(stderr, "Invalid mutex object\n"); 45 fprintf(stderr, "The current thread already owns the mutex\n");
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/ |
3-1.c | 20 pthread_mutex_t mutex; local 23 /* Initialize a mutex object with the default mutex attributes */ 24 if ((rc = pthread_mutex_init(&mutex, NULL)) != 0) { 29 /* Try to lock the mutex using pthread_mutex_trylock() */ 30 if ((rc = pthread_mutex_trylock(&mutex)) == 0) { 31 pthread_mutex_unlock(&mutex); 37 /* PATCH: since we are using the mutex properly, */ 40 fprintf(stderr, "The mutex was already locked\n"); 42 fprintf(stderr, "Invalid mutex object\n") [all...] |
4-1.c | 10 * -[EBUSY] The mutex could not be acquired because it was already locked. 13 * -- Initilize a mutex object 14 * -- Lock the mutex using pthread_mutex_lock() 15 * -- Try to lock the mutex using pthread_mutex_trylock() and expect EBUSY 24 pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; variable 30 if ((rc = pthread_mutex_lock(&mutex)) != 0) { 35 rc = pthread_mutex_trylock(&mutex); 42 pthread_mutex_unlock(&mutex); 43 pthread_mutex_destroy(&mutex);
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/ |
1-1.c | 9 * shall release the mutex object 'mutex'. 12 * -- Initilize a mutex object 13 * -- Get the mutex using pthread_mutex_lock() 14 * -- Release the mutex using pthread_mutex_unlock() 15 * -- Try to get the mutex using pthread_mutex_trylock() 16 * -- Release the mutex using pthread_mutex_unlock() 25 pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; variable 31 /* Get the mutex using pthread_mutex_lock() */ 32 if ((rc = pthread_mutex_lock(&mutex)) != 0) [all...] |
3-1.c | 20 pthread_mutex_t mutex; local 23 /* Initialize a mutex object */ 24 if ((rc = pthread_mutex_init(&mutex, NULL)) != 0) { 29 if ((rc = pthread_mutex_lock(&mutex)) != 0) { 34 /* Release the mutex using pthread_mutex_unlock() */ 35 if ((rc = pthread_mutex_unlock(&mutex)) == 0) { 42 fprintf(stderr, "Current thread does not own the mutex\n"); 45 fprintf(stderr, "Invalid mutex object\n");
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/ |
3-1.c | 12 * Provides errorchecking. A thread attempting to relock this mutex without unlocking it 13 * first will return with an error. A thread attempting to unlock a mutex which another 15 * mutex will return with an error. 20 * 3. Create a mutex with that mutexattr object. 21 * 4. Attempt to relock a mutex without unlocking it first. It should return an error. 34 pthread_mutex_t mutex; local 37 /* Initialize a mutex attributes object */ 49 /* Initialize the mutex with that attribute obj. */ 50 if (pthread_mutex_init(&mutex, &mta) != 0) { 51 perror("Error intializing the mutex.\n") [all...] |
3-3.c | 12 Provides errorchecking. A thread attempting to relock this mutex without unlocking it 13 first will return with an error. A thread attempting to unlock a mutex which another 15 mutex will return with an error. 20 * 3. Create a mutex with that mutexattr object. 34 pthread_mutex_t mutex; local 37 /* Initialize a mutex attributes object */ 49 /* Initialize the mutex with that attribute obj. */ 50 if (pthread_mutex_init(&mutex, &mta) != 0) { 51 perror("Error intializing the mutex.\n"); 55 /* Unlock an already unlocked mutex. Here, an error should be returned. * [all...] |
3-4.c | 12 Provides errorchecking. A thread attempting to relock this mutex without unlocking it 13 first will return with an error. A thread attempting to unlock a mutex which another 15 mutex will return with an error. 20 * 3. Create a mutex with that mutexattr object. 21 * 4. Attempt to unlock an unlocked mutex. It should return an error. 34 pthread_mutex_t mutex; local 37 /* Initialize a mutex attributes object */ 49 /* Initialize the mutex with that attribute obj. */ 50 if (pthread_mutex_init(&mutex, &mta) != 0) { 51 perror("Error intializing the mutex.\n") [all...] |
/external/parameter-framework/asio-1.10.6/include/asio/detail/ |
mutex.hpp | 2 // detail/mutex.hpp 27 typedef posix_mutex mutex; typedef in namespace:asio::detail 29 typedef std_mutex mutex;
|
/external/valgrind/drd/tests/ |
pth_process_shared_mutex.c | 2 * Test program that locks and unlocks a process-shared mutex. 15 pthread_mutex_t mutex; local 20 pthread_mutex_init(&mutex, &attr); 23 pthread_mutex_lock(&mutex); 24 pthread_mutex_unlock(&mutex); 25 pthread_mutex_destroy(&mutex);
|
/external/valgrind/helgrind/tests/ |
cond_timedwait_invalid.c | 10 pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; local 21 assert(pthread_mutex_lock(&mutex)==0); 22 assert(pthread_cond_timedwait(&cond, &mutex, &abstime)==EINVAL); 23 assert(pthread_mutex_unlock(&mutex)==0);
|
cond_timedwait_test.c | 5 pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; local 12 pthread_mutex_lock(&mutex); 13 pthread_cond_timedwait(&cond, &mutex, &now); 14 pthread_mutex_unlock(&mutex); 16 pthread_mutex_destroy(&mutex);
|
/prebuilts/ndk/r16/sources/cxx-stl/llvm-libc++/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/ |
try_lock_until.pass.cpp | 15 // template <class Mutex> class shared_lock; 27 struct mutex struct 40 mutex m; 45 std::shared_lock<mutex> lk(m, std::defer_lock);
|
/prebuilts/ndk/r16/sources/cxx-stl/llvm-libc++/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/ |
try_lock_until.pass.cpp | 12 // <mutex> 14 // template <class Mutex> class unique_lock; 19 #include <mutex> 26 struct mutex struct 39 mutex m; 44 std::unique_lock<mutex> lk(m, std::defer_lock);
|
/system/netd/server/ |
EventReporter.h | 22 #include <mutex> 42 // std::atomic<android::net::metrics::INetdEventListener> and deleting the mutex. 48 std::mutex mutex; member in class:EventReporter
|