/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/ |
1-1.c | 24 pthread_mutex_t mutex; member in struct:testdata 36 if (pthread_mutex_lock(&td.mutex) != 0) { 37 fprintf(stderr, "[Thread 0x%p] failed to acquire the mutex\n", 42 fprintf(stderr, "[Thread 0x%p] started and locked the mutex\n", 47 rc = pthread_cond_wait(&td.cond, &td.mutex); 53 fprintf(stderr, "[Thread 0x%p] was wakened and acquired the mutex " 56 if (pthread_mutex_unlock(&td.mutex) != 0) { 57 fprintf(stderr, "[Thread 0x%p] failed to release the mutex\n", 61 fprintf(stderr, "[Thread 0x%p] released the mutex\n", (void *)self); 70 if (pthread_mutex_init(&td.mutex, NULL) != 0) [all...] |
2-1.c | 11 * own the mutex with which it called pthread_cond_wait(). 25 pthread_mutex_t mutex; member in struct:testdata 37 if (pthread_mutex_lock(&td.mutex) != 0) { 38 fprintf(stderr, "[Thread 0x%p] failed to acquire the mutex\n", 42 fprintf(stderr, "[Thread 0x%p] started and locked the mutex\n", 48 rc = pthread_cond_wait(&td.cond, &td.mutex); 54 if (pthread_mutex_trylock(&td.mutex) == 0) { 56 "mutex again\n", (void *)self); 61 "mutex again\n", (void *)self); 64 if (pthread_mutex_unlock(&td.mutex) != 0) [all...] |
4-1.c | 24 pthread_mutex_t mutex; member in struct:testdata 36 if (pthread_mutex_lock(&td.mutex) != 0) { 37 fprintf(stderr, "[Thread 0x%p] failed to acquire the mutex\n", 41 fprintf(stderr, "[Thread 0x%p] started and locked the mutex\n", 47 rc = pthread_cond_wait(&td.cond, &td.mutex); 55 if (pthread_mutex_unlock(&td.mutex) != 0) { 56 fprintf(stderr, "[Thread 0x%p] failed to release the mutex\n", 68 if (pthread_mutex_init(&td.mutex, NULL) != 0) { 69 fprintf(stderr, "Fail to initialize mutex\n"); 86 /* Acquire the mutex to make sure that all waiters are currentl [all...] |
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/ |
1-1.c | 25 pthread_mutex_t mutex; member in struct:testdata 51 if (pthread_mutex_lock(&td.mutex) != 0) { 52 fprintf(stderr, "[Thread 0x%p] failed to acquire the mutex\n", 57 fprintf(stderr, "[Thread 0x%p] started and locked the mutex\n", 62 rc = pthread_cond_wait(&td.cond, &td.mutex); 69 "[Thread 0x%p] was wakened and acquired the mutex again\n", 72 if (pthread_mutex_unlock(&td.mutex) != 0) { 73 fprintf(stderr, "[Thread 0x%p] failed to release the mutex\n", 77 fprintf(stderr, "[Thread 0x%p] released the mutex\n", (void *)self); 86 if (pthread_mutex_init(&td.mutex, NULL) != 0) [all...] |
4-1.c | 25 pthread_mutex_t mutex; member in struct:testdata 51 if (pthread_mutex_lock(&td.mutex) != 0) { 52 fprintf(stderr, "[Thread 0x%p] failed to acquire the mutex\n", 61 rc = pthread_cond_wait(&td.cond, &td.mutex); 69 if (pthread_mutex_unlock(&td.mutex) != 0) { 70 fprintf(stderr, "[Thread 0x%p] failed to release the mutex\n", 82 if (pthread_mutex_init(&td.mutex, NULL) != 0) { 83 fprintf(stderr, "Fail to initialize mutex\n");
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/ |
1-1.c | 9 * shall block on a condition variable. It shall be called with mutex locked 26 pthread_mutex_t mutex; member in struct:testdata 41 if (pthread_mutex_lock(&td.mutex) != 0) { 42 fprintf(stderr, "Thread1: Fail to acquire mutex\n"); 57 rc = pthread_cond_timedwait(&td.cond, &td.mutex, &timeout); 76 pthread_mutex_unlock(&td.mutex); 84 if (pthread_mutex_init(&td.mutex, NULL) != 0) { 85 fprintf(stderr, "Fail to initialize mutex\n"); 100 /* acquire the mutex released by pthread_cond_wait() within thread 1 */ 101 if (pthread_mutex_lock(&td.mutex) != 0) [all...] |
2-1.c | 15 * Upon successful return, the mutex shall have been locked and shall 33 pthread_mutex_t mutex; member in struct:testdata 48 if (pthread_mutex_lock(&td.mutex) != 0) { 49 fprintf(stderr, "Thread1 failed to acquire the mutex\n"); 63 rc = pthread_cond_timedwait(&td.cond, &td.mutex, &timeout); 82 if (pthread_mutex_trylock(&td.mutex) == 0) { 84 "Thread1 should not be able to lock the mutex again\n"); 88 fprintf(stderr, "Thread1 failed to trylock the mutex (as expected)\n"); 90 if (pthread_mutex_unlock(&td.mutex) != 0) { 91 fprintf(stderr, "Thread1 failed to release the mutex\n") [all...] |
2-2.c | 29 pthread_mutex_t mutex; member in struct:testdata 45 /* Lock the mutex */ 46 if (pthread_mutex_lock(&td.mutex) != 0) { 47 fprintf(stderr, "Thread1 failed to acquire the mutex\n"); 62 /* Thread will now release the mutex and wait on the condition variable */ 66 rc = pthread_cond_timedwait(&td.cond, &td.mutex, &timeout); 83 if (pthread_mutex_init(&td.mutex, NULL) != 0) { 84 fprintf(stderr, "Fail to initialize mutex\n"); 100 /* acquire the mutex released by pthread_cond_wait() within thread 1 */ 101 if (pthread_mutex_lock(&td.mutex) != 0) [all...] |
2-3.c | 28 pthread_mutex_t mutex; member in struct:testdata 42 if (pthread_mutex_lock(&td.mutex) != 0) { 43 fprintf(stderr, "Thread1 failed to acquire the mutex\n"); 57 rc = pthread_cond_timedwait(&td.cond, &td.mutex, &timeout); 75 if (pthread_mutex_init(&td.mutex, NULL) != 0) { 76 fprintf(stderr, "Fail to initialize mutex\n"); 99 /* Make sure pthread_cond_timedwait released and re-acquired the mutex 101 rc = pthread_mutex_trylock(&td.mutex); 104 "Test FAILED: Did not re-acquire mutex after timedout out call to pthread_cond_timedwait\n"); 108 if (pthread_mutex_unlock(&td.mutex) != 0) [all...] |
3-1.c | 26 pthread_mutex_t mutex; member in struct:testdata 41 if (pthread_mutex_lock(&td.mutex) != 0) { 42 fprintf(stderr, "Thread1 failed to acquire the mutex\n"); 56 rc = pthread_cond_timedwait(&td.cond, &td.mutex, &timeout); 76 if (pthread_mutex_unlock(&td.mutex) != 0) { 77 fprintf(stderr, "Thread1 failed to release the mutex\n"); 80 fprintf(stderr, "Thread1 released the mutex\n"); 88 if (pthread_mutex_init(&td.mutex, NULL) != 0) { 89 fprintf(stderr, "Fail to initialize mutex\n"); 104 /* acquire the mutex released by pthread_cond_wait() within thread 1 * [all...] |
4-1.c | 26 pthread_mutex_t mutex; member in struct:testdata 38 if (pthread_mutex_lock(&td.mutex) != 0) { 39 fprintf(stderr, "Thread1 failed to acquire the mutex\n"); 53 rc = pthread_cond_timedwait(&td.cond, &td.mutex, &timeout); 72 if (pthread_mutex_init(&td.mutex, NULL) != 0) { 73 fprintf(stderr, "Fail to initialize mutex\n");
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/ |
1-1.c | 9 * shall block on a condition variable. It shall be called with mutex locked 23 pthread_mutex_t mutex; member in struct:testdata 44 if (pthread_mutex_lock(&td.mutex) != 0) { 45 fprintf(stderr, "Thread1 failed to acquire mutex\n"); 52 rc = pthread_cond_wait(&td.cond, &td.mutex); 64 pthread_mutex_unlock(&td.mutex); 72 if (pthread_mutex_init(&td.mutex, NULL) != 0) { 73 fprintf(stderr, "Fail to initialize mutex\n"); 88 /* acquire the mutex released by pthread_cond_wait() within thread 1 */ 89 if (pthread_mutex_lock(&td.mutex) != 0) [all...] |
2-1.c | 9 * Upon successful return, the mutex shall have been locked and shall be owned 23 pthread_mutex_t mutex; member in struct:testdata 44 if (pthread_mutex_lock(&td.mutex) != 0) { 45 fprintf(stderr, "Thread1 failed to acquire the mutex\n"); 52 rc = pthread_cond_wait(&td.cond, &td.mutex); 64 if (pthread_mutex_trylock(&td.mutex) == 0) { 66 "Thread1 should not be able to lock the mutex again\n"); 70 fprintf(stderr, "Thread1 failed to trylock the mutex (as expected)\n"); 72 if (pthread_mutex_unlock(&td.mutex) != 0) { 73 fprintf(stderr, "Thread1 failed to release the mutex\n") [all...] |
3-1.c | 21 pthread_mutex_t mutex; member in struct:testdata 42 if (pthread_mutex_lock(&td.mutex) != 0) { 43 fprintf(stderr, "Thread1 failed to acquire the mutex\n"); 50 rc = pthread_cond_wait(&td.cond, &td.mutex); 69 if (pthread_mutex_unlock(&td.mutex) != 0) { 70 fprintf(stderr, "Thread1 failed to release the mutex\n"); 73 fprintf(stderr, "Thread1 released the mutex\n"); 82 if (pthread_mutex_init(&td.mutex, NULL) != 0) { 83 fprintf(stderr, "Fail to initialize mutex\n");
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/ |
1-1.c | 9 * shall lock the mutex object referenced by 'mutex'. If the mutex is 10 * already locked, the calling thread shall block until the mutex becomes 11 * available. This operation shall return with the mutex object referenced 12 * by 'mutex' in the locked state with the calling thread as its owner. 15 * -- Initialize a mutex to protect a global variable 'value' 16 * -- Create N threads. Each is looped M times to acquire the mutex, 17 * increase the value, and then release the mutex. 18 * -- Check if the value has increased properly (M*N); a broken mutex 35 pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; variable [all...] |
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/ |
2-1.c | 9 * locks the mutex object referenced by 'mutex'. If the mutex is 10 * already locked, the calling thread shall block until the mutex becomes 18 * 1. Create a mutex in the main() thread and lock it. 21 * 3. Save the time before and after the thread tried to lock the mutex. 22 * 4. After the thread has ended, main() will compare the times before and after the mutex 43 pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; /* The mutex */ variable 45 and after locking the mutex usin [all...] |
5-1.c | 43 pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; /* The mutex */ variable 45 and afer locking the mutex using 89 /* Lock the mutex */ 90 if (pthread_mutex_lock(&mutex) != 0) { 101 ret = pthread_mutex_timedlock(&mutex, &timeout); 104 if (pthread_mutex_unlock(&mutex) != 0) { 109 if (pthread_mutex_destroy(&mutex) != 0) {
|
5-2.c | 43 pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; /* The mutex */ variable 45 and afer locking the mutex using 89 /* Lock the mutex */ 90 if (pthread_mutex_lock(&mutex) != 0) { 101 ret = pthread_mutex_timedlock(&mutex, &timeout); 104 if (pthread_mutex_unlock(&mutex) != 0) { 109 if (pthread_mutex_destroy(&mutex) != 0) {
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/ |
2-1.c | 9 * If there are threads blocked on the mutex object referenced by 'mutex' when 10 * pthread_mutex_unlock() is called, resulting in the mutex becoming available, 11 * the scheduling policy shall determine which thread shall acquire the mutex. 18 * -- Initialize a mutex to protect a global variable 'value' 19 * -- Create N threads. Each is looped M times to acquire the mutex, 20 increase the value, and then release the mutex. 21 * -- Check if the value has increased properly (M*N); a broken mutex 38 pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; variable 39 int value; /* value protected by mutex */ [all...] |
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setcanceltype/ |
1-1.c | 16 * 1. Setup a mutex and lock it in main() 20 * 5. Make the thread block on the locked mutex 24 * 8. If not, main will wait for 10 seconds before it unlocks the mutex, and the thread 40 pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; /* Mutex */ variable 61 /* Lock the mutex. It should have already been locked in main, so the thread 63 if (pthread_mutex_lock(&mutex) != 0) { 86 /* Lock the mutex */ 87 if (pthread_mutex_lock(&mutex) != 0) { 116 /* Unlock the mutex */ [all...] |
/external/mesa3d/src/gallium/drivers/llvmpipe/ |
lp_fence.h | 46 pipe_mutex mutex; member in struct:lp_fence
|
/external/mesa3d/src/mesa/state_tracker/ |
st_cb_syncobj.c | 44 mtx_t mutex; /**< protects "fence" */ member in struct:st_sync_object 54 mtx_init(&so->mutex, mtx_plain); 68 mtx_destroy(&so->mutex); 95 mtx_lock(&so->mutex); 97 mtx_unlock(&so->mutex); 106 mtx_unlock(&so->mutex); 121 mtx_lock(&so->mutex); 123 mtx_unlock(&so->mutex);
|
/external/mesa3d/src/util/ |
slab.h | 51 mtx_t mutex; member in struct:slab_parent_pool 67 * This list is protected by the parent mutex.
|
/external/parameter-framework/asio-1.10.6/include/asio/detail/ |
scoped_lock.hpp | 22 // Helper class to lock and unlock a mutex automatically. 23 template <typename Mutex> 32 scoped_lock(Mutex& m, adopt_lock_t) 39 explicit scoped_lock(Mutex& m) 79 // Get the underlying mutex. 80 Mutex& mutex() function in class:asio::detail::scoped_lock 86 // The underlying mutex. 87 Mutex& mutex_; 89 // Whether the mutex is currently locked or unlocked [all...] |
/external/swiftshader/src/Common/ |
MutexLock.hpp | 21 // Use a pthread mutex on Linux. Since many processes may use SwiftShader 32 pthread_mutex_init(&mutex, NULL); 37 pthread_mutex_destroy(&mutex); 42 return pthread_mutex_trylock(&mutex) == 0; 47 pthread_mutex_lock(&mutex); 52 pthread_mutex_unlock(&mutex); 56 pthread_mutex_t mutex; member in class:sw::MutexLock 71 mutex = 0; 78 if(mutex.exchange(true) == false) 153 mutex.store(false, std::memory_order_release) 191 sw::MutexLock &mutex; member in class:LockGuard [all...] |