/external/ltp/utils/ffsb-6.0-rc2/ |
H A D | rwlock.h | 27 struct rwlock { struct 38 void init_rwlock(struct rwlock *rw); 40 void rw_lock_read(struct rwlock *rw); 41 void rw_lock_write(struct rwlock *rw); 43 void rw_unlock_read(struct rwlock *rw); 44 void rw_unlock_write(struct rwlock *rw); 46 int rw_trylock_read(struct rwlock *rw); 47 int rw_trylock_write(struct rwlock *rw);
|
/external/compiler-rt/test/tsan/ |
H A D | write_in_reader_lock.cc | 4 pthread_rwlock_t rwlock; variable 9 pthread_rwlock_rdlock(&rwlock); 13 pthread_rwlock_unlock(&rwlock); 19 pthread_rwlock_init(&rwlock, NULL); 20 pthread_rwlock_rdlock(&rwlock); 25 pthread_rwlock_unlock(&rwlock); 28 pthread_rwlock_destroy(&rwlock);
|
/external/llvm/lib/Support/ |
H A D | RWMutex.cpp | 50 pthread_rwlock_t* rwlock = 55 bzero(rwlock, sizeof(pthread_rwlock_t)); 58 // Initialize the rwlock 59 int errorcode = pthread_rwlock_init(rwlock, nullptr); 64 data_ = rwlock; 70 pthread_rwlock_t* rwlock = static_cast<pthread_rwlock_t*>(data_); 71 assert(rwlock != nullptr); 72 pthread_rwlock_destroy(rwlock); 73 free(rwlock); 79 pthread_rwlock_t* rwlock [all...] |
/external/swiftshader/third_party/LLVM/lib/Support/ |
H A D | RWMutex.cpp | 52 // pthread_rwlock_init does have an address, then rwlock support is enabled. 66 pthread_rwlock_t* rwlock = 71 bzero(rwlock, sizeof(pthread_rwlock_t)); 74 // Initialize the rwlock 75 int errorcode = pthread_rwlock_init(rwlock, NULL); 80 data_ = rwlock; 89 pthread_rwlock_t* rwlock = static_cast<pthread_rwlock_t*>(data_); 90 assert(rwlock != 0); 91 pthread_rwlock_destroy(rwlock); 92 free(rwlock); [all...] |
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_wrlock/ |
H A D | 3-1.c | 7 * Test pthread_rwlock_wrlock(pthread_rwlock_t *rwlock) 10 * [EDEADLK] The current thread already owns the rwlock for writing or reading. 13 * 1. Create and initialize an rwlock 15 * 3. Perform a write lock _again_ with pthread_rwlock_wrlock without first unlocking rwlock() 30 static pthread_rwlock_t rwlock; local 33 if (pthread_rwlock_init(&rwlock, NULL) != 0) { 38 /* Attempt to write lock rwlock, it should return successfully */ 41 if (pthread_rwlock_wrlock(&rwlock) != 0) { 47 /* Now attempt to write lock again without first unlocking rwlock. It may return 51 rc = pthread_rwlock_wrlock(&rwlock); [all...] |
H A D | 1-1.c | 7 * Test pthread_rwlock_wrlock(pthread_rwlock_t *rwlock) 10 * 'rwlock'. The calling thread acquires the write lock if no other thread 11 * (reader or writer) holds the read-write lock 'rwlock'. Otherwise, the thread 15 * 1. Initialize a pthread_rwlock_t object 'rwlock' with pthread_rwlock_init() 16 * 2. Main thread lock 'rwlock' for reading with pthread_rwlock_rdlock() 17 * 3. Create a child thread, the thread lock 'rwlock' for writing, shall block 18 * 4. Main thread unlock 'rwlock', child thread should get the write lock 19 * 5. Main thread lock 'rwlock' for writing 20 * 6. Create child thread to lock 'rwlock' for writing, should block 21 * 7. Main thread unlock 'rwlock' 32 static pthread_rwlock_t rwlock; variable [all...] |
/external/valgrind/drd/tests/ |
H A D | trylock.c | 23 pthread_rwlock_t rwlock; local 30 r = pthread_rwlock_init(&rwlock, NULL); assert(r == 0); 31 fprintf(stderr, "Locking rwlock via pthread_rwlock_wrlock().\n"); 32 r = pthread_rwlock_wrlock(&rwlock); assert(r == 0); 33 r = pthread_rwlock_unlock(&rwlock); assert(r == 0); 34 fprintf(stderr, "Locking rwlock via pthread_rwlock_trywrlock().\n"); 35 r = pthread_rwlock_trywrlock(&rwlock); assert(r == 0); 36 r = pthread_rwlock_unlock(&rwlock); assert(r == 0); 37 fprintf(stderr, "Locking rwlock via pthread_rwlock_timedwrlock().\n"); 39 r = pthread_rwlock_timedwrlock(&rwlock, [all...] |
H A D | hold_lock.c | 30 pthread_rwlock_t rwlock; local 58 fprintf(stderr, "Locking rwlock exclusively ...\n"); 60 pthread_rwlock_init(&rwlock, 0); 61 pthread_rwlock_wrlock(&rwlock); 63 pthread_rwlock_unlock(&rwlock); 64 pthread_rwlock_destroy(&rwlock); 66 fprintf(stderr, "Locking rwlock shared ...\n"); 68 pthread_rwlock_init(&rwlock, 0); 69 pthread_rwlock_rdlock(&rwlock); 71 pthread_rwlock_rdlock(&rwlock); [all...] |
H A D | trylock.stderr.exp | 2 Locking rwlock via pthread_rwlock_wrlock(). 3 Locking rwlock via pthread_rwlock_trywrlock(). 4 Locking rwlock via pthread_rwlock_timedwrlock(). 5 Locking rwlock via pthread_rwlock_rdlock(). 6 Locking rwlock via pthread_rwlock_tryrdlock(). 7 Locking rwlock via pthread_rwlock_timedrdlock(). 9 Recursive writer locking not allowed: rwlock 0x......... 12 rwlock 0x........ was first observed at:
|
H A D | rwlock_type_checking.stderr.exp | 2 Attempt to use a user-defined rwlock as a POSIX rwlock: rwlock 0x......... 5 rwlock 0x........ was first observed at: 8 Attempt to use a POSIX rwlock as a user-defined rwlock: rwlock 0x......... 10 rwlock 0x........ was first observed at:
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_destroy/ |
H A D | 3-1.c | 10 * by rwlock while it is locked. 26 pthread_rwlock_t rwlock; local 29 if (pthread_rwlock_init(&rwlock, NULL) != 0) { 34 if (pthread_rwlock_rdlock(&rwlock) != 0) { 39 /* Attempt to destroy an already locked rwlock */ 40 rc = pthread_rwlock_destroy(&rwlock);
|
H A D | 1-1.c | 7 * The function shall destroy the read-write lock object referenced by rwlock 26 pthread_rwlock_t rwlock; local 31 if (pthread_rwlock_init(&rwlock, NULL) != 0) { 36 rc = pthread_rwlock_destroy(&rwlock);
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/ |
H A D | 6-1.c | 11 * referenced by rwlock, a previously initialized but not yet destroyed read-write 15 * 1. Initialize a pthread_rwlock_t object 'rwlock' with pthread_rwlock_init(). 30 static pthread_rwlock_t rwlock; local 33 /* Initialize the rwlock */ 34 rc = pthread_rwlock_init(&rwlock, NULL); 43 rc = pthread_rwlock_init(&rwlock, NULL); 46 if (pthread_rwlock_destroy(&rwlock) != 0) {
|
H A D | 3-1.c | 13 * 1. Initialize a pthread_rwlock_t object 'rwlock' with pthread_rwlock_init() 28 static pthread_rwlock_t rwlock; variable 40 if (pthread_rwlock_init(&rwlock, &rwlockattr) != 0) { 46 if (pthread_rwlock_rdlock(&rwlock) != 0) { 53 if (pthread_rwlock_unlock(&rwlock) != 0) { 60 if (pthread_rwlock_wrlock(&rwlock) != 0) { 67 if (pthread_rwlock_unlock(&rwlock) != 0) { 75 if (pthread_rwlock_destroy(&rwlock) != 0) {
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_trywrlock/speculative/ |
H A D | 3-1.c | 7 * Test pthread_rwlock_trywrlock(pthread_rwlock_t *rwlock) 10 * [EINVAL] rwlock does not refer to an intialized read-write lock object 13 * 1. Call pthread_rwlock_trywrlock with an uninitialized rwlock object 27 static pthread_rwlock_t rwlock; local 30 /* Call without initializing rwlock */ 31 rc = pthread_rwlock_trywrlock(&rwlock); 34 if (pthread_rwlock_unlock(&rwlock) != 0) { 39 if (pthread_rwlock_destroy(&rwlock) != 0) {
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/ |
H A D | 5-1.c | 7 * Test that pthread_rwlock_rdlock(pthread_rwlock_t *rwlock) 9 * A thread may hold multiple concurrent read locks on 'rwlock' and the application shall 13 * 1. Initialize a pthread_rwlock_t object 'rwlock' with pthread_rwlock_init() 14 * 2. Main read locks 'rwlock' 10 times 15 * 3. Main unlocks 'rwlock' 10 times. 30 static pthread_rwlock_t rwlock; local 33 if (pthread_rwlock_init(&rwlock, NULL) != 0) { 39 if (pthread_rwlock_rdlock(&rwlock) != 0) { 41 ("Test FAILED: main cannot get read-lock rwlock number: %d\n", 48 if (pthread_rwlock_unlock(&rwlock) ! [all...] |
H A D | 1-1.c | 7 * Test that pthread_rwlock_rdlock(pthread_rwlock_t *rwlock) 10 * read-write lock referenced by rwlock. The calling thread acquires 18 * 1. Initialize a pthread_rwlock_t object 'rwlock' with pthread_rwlock_init() 19 * 2. Main thread read lock 'rwlock' 20 * 3. Create a child thread. The thread read lock 'rwlock', should not block. Then unlock it. 21 * 4. Main thread unlock 'rwlock' 22 * 5. Main thread write lock 'rwlock' 23 * 6. Create child thread to read lock 'rwlock', should block 24 * 7. Main thread unlock 'rwlock' 33 static pthread_rwlock_t rwlock; variable [all...] |
/external/valgrind/drd/ |
H A D | drd_rwlock.h | 43 struct rwlock_info* DRD_(rwlock_pre_init)(const Addr rwlock, 45 void DRD_(rwlock_post_destroy)(const Addr rwlock, const RwLockT rwlock_type); 46 void DRD_(rwlock_pre_rdlock)(const Addr rwlock, const RwLockT rwlock_type); 47 void DRD_(rwlock_post_rdlock)(const Addr rwlock, const RwLockT rwlock_type, 49 void DRD_(rwlock_pre_wrlock)(const Addr rwlock, const RwLockT rwlock_type); 50 void DRD_(rwlock_post_wrlock)(const Addr rwlock, const RwLockT rwlock_type, 52 void DRD_(rwlock_pre_unlock)(const Addr rwlock, const RwLockT rwlock_type);
|
/external/libcups/cups/ |
H A D | thread.c | 107 _cupsRWInit(_cups_rwlock_t *rwlock) /* I - Reader/writer lock */ argument 109 pthread_rwlock_init(rwlock, NULL); 118 _cupsRWLockRead(_cups_rwlock_t *rwlock) /* I - Reader/writer lock */ argument 120 pthread_rwlock_rdlock(rwlock); 129 _cupsRWLockWrite(_cups_rwlock_t *rwlock)/* I - Reader/writer lock */ argument 131 pthread_rwlock_wrlock(rwlock); 140 _cupsRWUnlock(_cups_rwlock_t *rwlock) /* I - Reader/writer lock */ argument 142 pthread_rwlock_unlock(rwlock); 294 _cupsRWInit(_cups_rwlock_t *rwlock) /* I - Reader/writer lock */ argument 296 _cupsMutexInit((_cups_mutex_t *)rwlock); 305 _cupsRWLockRead(_cups_rwlock_t *rwlock) argument 316 _cupsRWLockWrite(_cups_rwlock_t *rwlock) argument 327 _cupsRWUnlock(_cups_rwlock_t *rwlock) argument 457 _cupsRWInit(_cups_rwlock_t *rwlock) argument 468 _cupsRWLockRead(_cups_rwlock_t *rwlock) argument 479 _cupsRWLockWrite(_cups_rwlock_t *rwlock) argument 490 _cupsRWUnlock(_cups_rwlock_t *rwlock) argument [all...] |
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/ |
H A D | 1-1.c | 7 * Test that pthread_rwlock_unlock(pthread_rwlock_t *rwlock) 10 * read-write lock object referenced by rwlock 18 * 1. Initialize a pthread_rwlock_t object 'rwlock' with pthread_rwlock_init() 19 * 2. Main thread read lock 'rwlock' 20 * 3. Create a child thread, the thread read lock 'rwlock', should not block 21 * 4. Child thread unlock 'rwlock', while the main thread still hold the read lock. 22 * 5. Child thread read lock 'rwlock' again, should succeed, then unlock again 23 * 6. Child thread write lock 'rwlock', should block 24 * 7. Main thread unlock the read lock, the 'rwlock' is in unlocked state 34 static pthread_rwlock_t rwlock; variable [all...] |
H A D | 4-1.c | 7 * Test that pthread_rwlock_unlock(pthread_rwlock_t *rwlock) 10 * [EINVAL] rwlock doesn't refer to an intialized read-write lock 11 * [EPERM] the current thread doesn't hold the lock on the rwlock 16 * 1. Call pthread_rwlock_unlock with an uninitialized rwlock 32 static pthread_rwlock_t rwlock; local 36 printf("Unlocking uninitialized rwlock is undefined on Linux\n"); 40 rc = pthread_rwlock_unlock(&rwlock);
|
H A D | 2-1.c | 7 * Test that pthread_rwlock_unlock(pthread_rwlock_t *rwlock) 10 * read-write lock object referenced by rwlock 18 * 1. Initialize a pthread_rwlock_t object 'rwlock' with pthread_rwlock_init() 19 * 2. Main thread write lock 'rwlock' 20 * 3. Create a child thread, the thread write lock 'rwlock', should block 21 * 4. Main thread unlock the write lock, the 'rwlock' is in unlocked state 31 static pthread_rwlock_t rwlock; variable 51 if (pthread_rwlock_wrlock(&rwlock) != 0) { 57 rc = pthread_rwlock_unlock(&rwlock); 75 if (pthread_rwlock_init(&rwlock, NUL [all...] |
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_tryrdlock/ |
H A D | 1-1.c | 7 * Test that pthread_rwlock_tryrdlock(pthread_rwlock_t *rwlock) 19 * 1. Initialize a pthread_rwlock_t object 'rwlock' with pthread_rwlock_init() 20 * 2. Main thread read lock 'rwlock' 21 * 3. Create a child thread, the thread read lock 'rwlock' using pthread_rwlock_tryrdlock(), should success 22 * 4. Main thread unlock 'rwlock' 23 * 5. Main thread write lock 'rwlock' 24 * 6. Create child thread to read lock 'rwlock' with pthread_rwlock_tryrdlock(), should not block and get EBUSY 25 * 7. Main thread unlock 'rwlock' 35 static pthread_rwlock_t rwlock; variable 54 rc = pthread_rwlock_tryrdlock(&rwlock); [all...] |
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/ |
H A D | 2-1.c | 7 * Test that pthread_rwlock_timedrdlock(pthread_rwlock_t *rwlock) 15 * 1. Initialize a pthread_rwlock_t object 'rwlock' with pthread_rwlock_init() 16 * 2. Main thread lock 'rwlock' for writing with pthread_rwlock_rdlock() 19 * 4. The thread lock 'rwlock' for reading, using pthread_rwlock_timedrdlock(). Should 44 static pthread_rwlock_t rwlock; variable 62 rc = pthread_rwlock_timedrdlock(&rwlock, &abs_timeout); 70 if (pthread_rwlock_unlock(&rwlock) != 0) { 95 if (pthread_rwlock_init(&rwlock, NULL) != 0) { 101 if (pthread_rwlock_wrlock(&rwlock) != 0) { 139 if (pthread_rwlock_unlock(&rwlock) ! [all...] |
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/ |
H A D | 2-1.c | 7 * Test that pthread_rwlock_timedwrlock(pthread_rwlock_t *rwlock) 15 * 1. Initialize 'rwlock' 16 * 2. Main thread locks 'rwlock' for writing with pthread_rwlock_wrlock() 20 * 4. The thread locks 'rwlock' for writing, using pthread_rwlock_timedwrlock(). Should 36 static pthread_rwlock_t rwlock; variable 68 rc = pthread_rwlock_timedwrlock(&rwlock, &abs_timeout); 77 if (pthread_rwlock_unlock(&rwlock) != 0) { 98 if (pthread_rwlock_init(&rwlock, NULL) != 0) { 105 if (pthread_rwlock_wrlock(&rwlock) != 0) { 147 if (pthread_rwlock_unlock(&rwlock) ! [all...] |