/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/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);
|
1-1.c | 5 * the mutex with PTHREAD_PRIO_PROTECT. 32 pthread_mutex_t mutex; local 53 /* Initialize a mutex object */ 54 error = pthread_mutex_init(&mutex, &mutex_attr); 60 /* Get the prioceiling of the mutex. */ 61 error = pthread_mutex_getprioceiling(&mutex, &prioceiling); 69 (void)pthread_mutex_destroy(&mutex);
|
3-2.c | 7 * The protocol attribute of mutex is PTHREAD_PRIO_NONE. 36 pthread_mutex_t mutex; local 56 /* Initialize a mutex object */ 57 error = pthread_mutex_init(&mutex, &mutex_attr); 63 /* Get the prioceiling of the mutex. */ 64 error = pthread_mutex_getprioceiling(&mutex, &prioceiling); 77 (void)pthread_mutex_destroy(&mutex);
|
3-3.c | 7 * The protocol attribute of mutex is PTHREAD_PRIO_NONE. 37 pthread_mutex_t mutex; local 58 /* Initialize a mutex object */ 59 error = pthread_mutex_init(&mutex, &mutex_attr); 65 /* Get the prioceiling of the mutex. */ 66 error = pthread_mutex_getprioceiling(&mutex, &prioceiling); 79 (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. 33 pthread_mutex_t mutex; local 36 /* Initialize a mutex attributes object */ 48 /* Initialize the mutex with that attribute obj. */ 49 if (pthread_mutex_init(&mutex, &mta) != 0) { 50 perror("Error initializing 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. 33 pthread_mutex_t mutex; local 36 /* Initialize a mutex attributes object */ 48 /* Initialize the mutex with that attribute obj. */ 49 if (pthread_mutex_init(&mutex, &mta) != 0) { 50 perror("Error initializing the mutex.\n"); 54 /* 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. 33 pthread_mutex_t mutex; local 36 /* Initialize a mutex attributes object */ 48 /* Initialize the mutex with that attribute obj. */ 49 if (pthread_mutex_init(&mutex, &mta) != 0) { 50 perror("Error initializing the mutex.\n") [all...] |
2-1.c | 12 * This type of mutex doesn't detect deadlock. So a thread attempting to relock this mutex 13 * without unlocking it first will not return an error. Attempting to unlock a mutex locked 14 * by a different thread results in undefined behavior. Attemping to unlock an unlocked mutex 20 * 3. Create a mutex with that mutexattr object. 21 * 4. Lock the mutex, then relock it. Expect dead lock. Timer will be use 43 pthread_mutex_t mutex; local 47 /* Initialize a mutex attributes object */ 59 /* Initialize the mutex with that attribute obj. */ 60 if (pthread_mutex_init(&mutex, &mta) != 0) [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/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_setprioceiling/ |
1-1.c | 6 * returns the current prioceiling of the mutex. 32 pthread_mutex_t mutex; local 53 /* Initialize a mutex object */ 54 error = pthread_mutex_init(&mutex, &mutex_attr); 60 /* Get the prioceiling of the mutex. */ 61 error = pthread_mutex_getprioceiling(&mutex, &prioceiling); 69 (void)pthread_mutex_destroy(&mutex);
|
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.2/Lib/ |
mutex.py | 3 A mutex has two pieces of state -- a 'locked' bit and a queue.
4 When the mutex is not locked, the queue is empty.
7 When the mutex is unlocked while the queue is not empty,
15 warnpy3k("the mutex module has been removed in Python 3.0", stacklevel=2)
20 class mutex:
class in inherits: 22 """Create a new mutex -- initially unlocked."""
27 """Test the locked bit of the mutex."""
40 """Lock a mutex, call the function with supplied argument
41 when it is acquired. If the mutex is already locked, place
49 """Unlock a mutex. If the queue is not empty, call the next [all...] |
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.2/Lib/test/ |
test_mutex.py | 4 mutex = test.test_support.import_module("mutex", deprecated=True)
variable 12 self.assertTrue(m.test(), "mutex not held")
18 self.assertTrue(m.test(), "mutex not held")
22 m = mutex.mutex()
29 self.assertFalse(m.test(), "mutex still held")
|