/external/clang/test/Modules/Inputs/thread-safety/ |
H A D | a.h | 1 struct __attribute__((lockable)) mutex { struct
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/ |
H A D | 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, NUL [all...] |
H A D | 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");
|
H A D | 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 afte [all...] |
/external/valgrind/memcheck/tests/darwin/ |
H A D | pth-supp.c | 6 pthread_rwlock_t mutex; local 7 pthread_rwlock_init(&mutex, NULL);
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/ |
H A D | 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);
|
H A D | 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);
|
H A D | 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);
|
H A D | 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/ |
H A D | 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 objec [all...] |
H A D | 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/ |
H A D | 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/ |
H A D | 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 objec [all...] |
H A D | 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/ |
H A D | 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)) ! [all...] |
H A D | 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/ |
H A D | 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 [all...] |
H A D | 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 [all...] |
H A D | 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 [all...] |
/external/parameter-framework/asio/include/asio/detail/ |
H A D | mutex.hpp | 2 // detail/mutex.hpp 27 typedef posix_mutex mutex; typedef in namespace:asio::detail 29 typedef std_mutex mutex;
|
/external/parameter-framework/asio-1.10.6/include/asio/detail/ |
H A D | 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/ |
H A D | 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/ |
H A D | 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);
|
H A D | 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);
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_setprioceiling/ |
H A D | 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);
|