Home
last modified time | relevance | path

Searched refs:rwlock (Results 26 - 50 of 59) sorted by relevance

123

/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/
H A D2-2.c7 * Test that pthread_rwlock_rdlock(pthread_rwlock_t *rwlock)
23 * 2. Main thread read lock 'rwlock'
26 * 4. The thread write lock 'rwlock', should block.
29 * 6. Reader thread read lock 'rwlock', should block, since there is an equal priority
30 * writer blocked on 'rwlock'
31 * 7. Main thread release the 'rwlock', the writer should get the lock first
48 static pthread_rwlock_t rwlock; variable
84 rc = pthread_rwlock_rdlock(&rwlock); in fn_rd()
96 if (pthread_rwlock_unlock(&rwlock) != 0) { in fn_rd()
115 rc = pthread_rwlock_wrlock(&rwlock); in fn_wr()
[all...]
H A D2-1.c7 * Test that pthread_rwlock_rdlock(pthread_rwlock_t *rwlock)
23 * 2. Main thread read lock 'rwlock'
26 * 4. The thread write lock 'rwlock', should block.
29 * 6. Reader thread read lock 'rwlock', should block, since there is a higher priority
30 * writer blocked on 'rwlock'
31 * 7. Main thread release the 'rwlock', the writer should get the lock first
48 static pthread_rwlock_t rwlock; variable
84 rc = pthread_rwlock_rdlock(&rwlock); in fn_rd()
96 if (pthread_rwlock_unlock(&rwlock) != 0) { in fn_rd()
115 rc = pthread_rwlock_wrlock(&rwlock); in fn_wr()
[all...]
H A D2-3.c7 * Test that pthread_rwlock_rdlock(pthread_rwlock_t *rwlock)
23 * 2. Main thread read lock 'rwlock'
26 * 4. The thread write lock 'rwlock', should block.
29 * 6. Reader thread read lock 'rwlock', shouldn't block, since it has a higher priority
30 * than the writer blocked on 'rwlock'
31 * 7. Main thread release the 'rwlock', the writer should get the lock first.
48 static pthread_rwlock_t rwlock; variable
84 rc = pthread_rwlock_rdlock(&rwlock); in fn_rd()
96 if (pthread_rwlock_unlock(&rwlock) != 0) { in fn_rd()
115 rc = pthread_rwlock_wrlock(&rwlock); in fn_wr()
[all...]
H A D5-1.c7 * 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.
29 static pthread_rwlock_t rwlock; in main() local
32 if (pthread_rwlock_init(&rwlock, NULL) != 0) { in main()
38 if (pthread_rwlock_rdlock(&rwlock) != 0) { in main()
40 ("Test FAILED: main cannot get read-lock rwlock number: %d\n", in main()
47 if (pthread_rwlock_unlock(&rwlock) ! in main()
[all...]
H A D4-1.c6 * Test pthread_rwlock_rdlock(pthread_rwlock_t * rwlock)
13 * 1. main thread create read-write lock 'rwlock', and lock it for writing
15 * 3. sig_thread try to lock 'rwlock' for reading but will block
18 * 6. check that when thread handler returns, sig_thread resumes blocking for rwlock
19 * 7. main thread unlock 'rwlock', sig_thread should get the lock
31 static pthread_rwlock_t rwlock; variable
70 rc = pthread_rwlock_rdlock(&rwlock); in th_fn()
80 if (pthread_rwlock_unlock(&rwlock) != 0) { in th_fn()
94 if (pthread_rwlock_init(&rwlock, NULL) != 0) { in main()
100 if (pthread_rwlock_wrlock(&rwlock) ! in main()
[all...]
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/
H A D2-1.c7 * 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
43 static pthread_rwlock_t rwlock; variable
61 rc = pthread_rwlock_timedrdlock(&rwlock, &abs_timeout); in fn_rd()
69 if (pthread_rwlock_unlock(&rwlock) != 0) { in fn_rd()
94 if (pthread_rwlock_init(&rwlock, NULL) != 0) { in main()
100 if (pthread_rwlock_wrlock(&rwlock) != 0) { in main()
138 if (pthread_rwlock_unlock(&rwlock) ! in main()
[all...]
H A D6-2.c6 * Test pthread_rwlock_timedrdlock(pthread_rwlock_t * rwlock)
14 * 1. main thread create read-write lock 'rwlock', and lock it for writing
16 * 3. sig_thread timed lock 'rwlock' for reading, but blocked
22 * 6. While sig_thread sleeping in signal handler, main thread unlock 'rwlock'
50 static pthread_rwlock_t rwlock; variable
104 rc = pthread_rwlock_timedrdlock(&rwlock, &abs_timeout); in th_fn()
127 if (pthread_rwlock_init(&rwlock, NULL) != 0) { in main()
133 if (pthread_rwlock_wrlock(&rwlock) != 0) { in main()
162 /* Wait for signal handler to sleep so that main can unlock the rwlock while in main()
163 * it is sleeping. (this way, the rwlock wil in main()
[all...]
H A D6-1.c6 * Test pthread_rwlock_timedrdlock(pthread_rwlock_t * rwlock)
18 * 1. main thread create and write lock 'rwlock'
20 * 3. sig_thread timed read-lock 'rwlock' for reading, it should block
40 static pthread_rwlock_t rwlock; variable
95 rc = pthread_rwlock_timedrdlock(&rwlock, &abs_timeout); in th_fn()
113 if (pthread_rwlock_init(&rwlock, NULL) != 0) { in main()
119 if (pthread_rwlock_wrlock(&rwlock) != 0) { in main()
132 * be block on rwlock since main() has the write lock at this point) */ in main()
183 if (pthread_rwlock_unlock(&rwlock) != 0) { in main()
193 if (pthread_rwlock_destroy(&rwlock) ! in main()
[all...]
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/
H A D2-1.c7 * 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
35 static pthread_rwlock_t rwlock; variable
67 rc = pthread_rwlock_timedwrlock(&rwlock, &abs_timeout); in fn()
76 if (pthread_rwlock_unlock(&rwlock) != 0) { in fn()
97 if (pthread_rwlock_init(&rwlock, NULL) != 0) { in main()
104 if (pthread_rwlock_wrlock(&rwlock) != 0) { in main()
146 if (pthread_rwlock_unlock(&rwlock) ! in main()
[all...]
H A D3-1.c7 * Test that pthread_rwlock_timedwrlock(pthread_rwlock_t *rwlock)
10 * read-write lock referenced by rwlock as in the pthread_rwlock_wrlock() function.
15 * 1. Initialize rwlock
18 * 4. Main thread locks 'rwlock' for reading with pthread_rwlock_rdlock()
19 * 5. Create a child thread, the thread time-locks 'rwlock' for writing,
22 * 6. Main thread unlocks 'rwlock'
23 * 7. Main thread locks 'rwlock' for writing.
24 * 8. Create child thread to lock 'rwlock' for writing, using pthread_rwlock_timedwrlock,
26 * 8. Main thread unlocks 'rwlock'
41 static pthread_rwlock_t rwlock; variable
[all...]
H A D1-1.c7 * Test that pthread_rwlock_timedwrlock(pthread_rwlock_t *rwlock)
10 * read-write lock referenced by rwlock as in the pthread_rwlock_wrlock() function.
15 * 1. Initialize rwlock
18 * 4. Main thread locks 'rwlock' for reading with pthread_rwlock_rdlock()
19 * 5. Create a child thread, the thread time-locks 'rwlock' for writing,
22 * 6. Main thread unlocks 'rwlock'
23 * 7. Main thread locks 'rwlock' for writing.
24 * 8. Create child thread to lock 'rwlock' for writing, using pthread_rwlock_timedwrlock,
26 * 8. Main thread unlocks 'rwlock'
39 static pthread_rwlock_t rwlock; variable
[all...]
H A D6-2.c6 * Test pthread_rwlock_timedwrlock(pthread_rwlock_t * rwlock)
14 * 1. main thread create read-write lock 'rwlock', and lock it for writing
16 * 3. sig_thread timed lock 'rwlock' for writing, but blocked
22 * 6. While sig_thread sleeping in signal handler, main thread unlock 'rwlock'
50 static pthread_rwlock_t rwlock; variable
104 rc = pthread_rwlock_timedwrlock(&rwlock, &abs_timeout); in th_fn()
127 if (pthread_rwlock_init(&rwlock, NULL) != 0) { in main()
133 if (pthread_rwlock_wrlock(&rwlock) != 0) { in main()
162 /* Wait for signal handler to sleep so that main can unlock the rwlock while in main()
163 * it is sleeping. (this way, the rwlock wil in main()
[all...]
H A D6-1.c6 * Test pthread_rwlock_timedwrlock(pthread_rwlock_t * rwlock)
18 * 1. main thread create and write lock 'rwlock'
20 * 3. sig_thread timed write-lock 'rwlock' for writing, it should block
40 static pthread_rwlock_t rwlock; variable
94 rc = pthread_rwlock_timedwrlock(&rwlock, &abs_timeout); in th_fn()
113 if (pthread_rwlock_init(&rwlock, NULL) != 0) { in main()
119 if (pthread_rwlock_wrlock(&rwlock) != 0) { in main()
132 * be block on rwlock since main() has the write lock at this point) */ in main()
182 if (pthread_rwlock_unlock(&rwlock) != 0) { in main()
192 if (pthread_rwlock_destroy(&rwlock) ! in main()
[all...]
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/
H A D4-2.c7 * Test that pthread_rwlock_unlock(pthread_rwlock_t *rwlock)
10 * [EINVAL] rwlock doesn't refer to an initialized read-write lock
11 * [EPERM] the current thread doesn't hold the lock on the rwlock
17 * 1. Initialize a pthread_rwlock_t object 'rwlock' with pthread_rwlock_init()
18 * 2. Main thread read lock 'rwlock'
19 * 3. Create a child thread, the thread should try to unlock the 'rwlock'
31 static pthread_rwlock_t rwlock; variable
48 rc = pthread_rwlock_unlock(&rwlock); in fn_unlk()
60 printf("Unlocking rwlock in different thread is undefined on Linux\n"); in main()
64 if (pthread_rwlock_init(&rwlock, NUL in main()
[all...]
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/
H A D2-1.c14 * 1. Initialize a pthread_rwlock_t object 'rwlock' with pthread_rwlock_init(),
16 * 2. Create a child thread, the thread lock 'rwlock' for reading, shall not block.
25 static pthread_rwlock_t rwlock; variable
35 rc = pthread_rwlock_rdlock(&rwlock); in fn_rd()
39 if (pthread_rwlock_unlock(&rwlock) != 0) { in fn_rd()
60 rc = pthread_rwlock_init(&rwlock, NULL); in main()
96 if (pthread_rwlock_destroy(&rwlock) != 0) { in main()
H A D1-1.c10 * required to use the read-write lock referenced by rwlock and
15 * 1. Initialize a pthread_rwlock_t object 'rwlock' with pthread_rwlock_init()
16 * 2. Create a child thread, the thread lock 'rwlock' for reading, shall not block.
25 static pthread_rwlock_t rwlock; variable
35 rc = pthread_rwlock_rdlock(&rwlock); in fn_rd()
39 if (pthread_rwlock_unlock(&rwlock) != 0) { in fn_rd()
67 rc = pthread_rwlock_init(&rwlock, &rwlockattr); in main()
104 if (pthread_rwlock_destroy(&rwlock) != 0) { in main()
H A D6-1.c11 * 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().
29 static pthread_rwlock_t rwlock; in main() local
32 /* Initialize the rwlock */ in main()
33 rc = pthread_rwlock_init(&rwlock, NULL); in main()
42 rc = pthread_rwlock_init(&rwlock, NULL); in main()
45 if (pthread_rwlock_destroy(&rwlock) != 0) { in main()
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_wrlock/
H A D2-1.c6 * Test pthread_rwlock_wrlock(pthread_rwlock_t * rwlock)
13 * 1. main thread create read-write lock 'rwlock', and lock it for writing
15 * 3. sig_thread try to lock 'rwlock' for writing but blocked
19 * 7. main thread unlock 'rwlock', sig_thread should get the lock
31 static pthread_rwlock_t rwlock; variable
71 rc = pthread_rwlock_wrlock(&rwlock); in th_fn()
81 if (pthread_rwlock_unlock(&rwlock) != 0) { in th_fn()
96 if (pthread_rwlock_init(&rwlock, NULL) != 0) { in main()
102 rc = pthread_rwlock_wrlock(&rwlock); in main()
165 if (pthread_rwlock_unlock(&rwlock) ! in main()
[all...]
/third_party/libuv/src/unix/
H A Dthread.c369 int uv_rwlock_init(uv_rwlock_t* rwlock) { in uv_rwlock_init() argument
370 return UV__ERR(pthread_rwlock_init(rwlock, NULL)); in uv_rwlock_init()
374 void uv_rwlock_destroy(uv_rwlock_t* rwlock) { in uv_rwlock_destroy() argument
375 if (pthread_rwlock_destroy(rwlock)) in uv_rwlock_destroy()
380 void uv_rwlock_rdlock(uv_rwlock_t* rwlock) { in uv_rwlock_rdlock() argument
381 if (pthread_rwlock_rdlock(rwlock)) in uv_rwlock_rdlock()
386 int uv_rwlock_tryrdlock(uv_rwlock_t* rwlock) { in uv_rwlock_tryrdlock() argument
389 err = pthread_rwlock_tryrdlock(rwlock); in uv_rwlock_tryrdlock()
400 void uv_rwlock_rdunlock(uv_rwlock_t* rwlock) { in uv_rwlock_rdunlock() argument
401 if (pthread_rwlock_unlock(rwlock)) in uv_rwlock_rdunlock()
406 uv_rwlock_wrlock(uv_rwlock_t* rwlock) uv_rwlock_wrlock() argument
412 uv_rwlock_trywrlock(uv_rwlock_t* rwlock) uv_rwlock_trywrlock() argument
426 uv_rwlock_wrunlock(uv_rwlock_t* rwlock) uv_rwlock_wrunlock() argument
[all...]
/third_party/node/deps/uv/src/unix/
H A Dthread.c376 int uv_rwlock_init(uv_rwlock_t* rwlock) { in uv_rwlock_init() argument
377 return UV__ERR(pthread_rwlock_init(rwlock, NULL)); in uv_rwlock_init()
381 void uv_rwlock_destroy(uv_rwlock_t* rwlock) { in uv_rwlock_destroy() argument
382 if (pthread_rwlock_destroy(rwlock)) in uv_rwlock_destroy()
387 void uv_rwlock_rdlock(uv_rwlock_t* rwlock) { in uv_rwlock_rdlock() argument
388 if (pthread_rwlock_rdlock(rwlock)) in uv_rwlock_rdlock()
393 int uv_rwlock_tryrdlock(uv_rwlock_t* rwlock) { in uv_rwlock_tryrdlock() argument
396 err = pthread_rwlock_tryrdlock(rwlock); in uv_rwlock_tryrdlock()
407 void uv_rwlock_rdunlock(uv_rwlock_t* rwlock) { in uv_rwlock_rdunlock() argument
408 if (pthread_rwlock_unlock(rwlock)) in uv_rwlock_rdunlock()
413 uv_rwlock_wrlock(uv_rwlock_t* rwlock) uv_rwlock_wrlock() argument
419 uv_rwlock_trywrlock(uv_rwlock_t* rwlock) uv_rwlock_trywrlock() argument
433 uv_rwlock_wrunlock(uv_rwlock_t* rwlock) uv_rwlock_wrunlock() argument
[all...]
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_destroy/
H A D3-1.c10 * by rwlock while it is locked.
25 pthread_rwlock_t rwlock; in main() local
28 if (pthread_rwlock_init(&rwlock, NULL) != 0) { in main()
33 if (pthread_rwlock_rdlock(&rwlock) != 0) { in main()
38 /* Attempt to destroy an already locked rwlock */ in main()
39 rc = pthread_rwlock_destroy(&rwlock); in main()
H A D1-1.c7 * The function shall destroy the read-write lock object referenced by rwlock
25 pthread_rwlock_t rwlock; in main() local
30 if (pthread_rwlock_init(&rwlock, NULL) != 0) { in main()
35 rc = pthread_rwlock_destroy(&rwlock); in main()
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_trywrlock/speculative/
H A D3-1.c7 * Test pthread_rwlock_trywrlock(pthread_rwlock_t *rwlock)
10 * [EINVAL] rwlock does not refer to an initialized read-write lock object
13 * 1. Call pthread_rwlock_trywrlock with an uninitialized rwlock object
26 static pthread_rwlock_t rwlock; in main() local
29 /* Call without initializing rwlock */ in main()
30 rc = pthread_rwlock_trywrlock(&rwlock); in main()
33 if (pthread_rwlock_unlock(&rwlock) != 0) { in main()
38 if (pthread_rwlock_destroy(&rwlock) != 0) { in main()
/third_party/musl/libc-test/src/functionalext/supplement/thread/thread_gtest/
H A Dthread_rwlock_test.cpp152 new RwlockHandleControl([&](pthread_rwlock_t* rwlock) { return pthread_rwlock_timedwrlock(rwlock, &times); }); in HWTEST_F()
186 [&](pthread_rwlock_t* rwlock) { return pthread_rwlock_timedwrlock_monotonic_np(rwlock, &times); }); in HWTEST_F()
204 [&](pthread_rwlock_t* rwlock) { return pthread_rwlock_clockwrlock(rwlock, CLOCK_MONOTONIC, &times); }); in HWTEST_F()
221 [&](pthread_rwlock_t* rwlock) { return pthread_rwlock_clockwrlock(rwlock, CLOCK_REALTIME, &times); }); in HWTEST_F()
233 pthread_rwlock_t rwlock = PTHREAD_RWLOCK_INITIALIZER; in HWTEST_F() local
235 EXPECT_EQ(EINVAL, pthread_rwlock_clockwrlock(&rwlock, CLOCK_THREAD_CPUTIME_I in HWTEST_F()
334 pthread_rwlock_t rwlock = PTHREAD_RWLOCK_INITIALIZER; HWTEST_F() local
[all...]
/third_party/skia/third_party/externals/dng_sdk/source/
H A Ddng_pthread.cpp861 int dng_pthread_rwlock_init(dng_pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attrs) in dng_pthread_rwlock_init() argument
869 *rwlock = newRWLock; in dng_pthread_rwlock_init()
876 int dng_pthread_rwlock_destroy(dng_pthread_rwlock_t *rwlock) in dng_pthread_rwlock_destroy() argument
878 dng_pthread_rwlock_impl &real_rwlock = **rwlock; in dng_pthread_rwlock_destroy()
890 delete *rwlock; in dng_pthread_rwlock_destroy()
891 *rwlock = NULL; in dng_pthread_rwlock_destroy()
902 int dng_pthread_rwlock_rdlock(dng_pthread_rwlock_t *rwlock) in dng_pthread_rwlock_rdlock() argument
904 dng_pthread_rwlock_impl &real_rwlock = **rwlock; in dng_pthread_rwlock_rdlock()
949 int dng_pthread_rwlock_tryrdlock(dng_pthread_rwlock_t *rwlock) in dng_pthread_rwlock_tryrdlock() argument
951 dng_pthread_rwlock_impl &real_rwlock = **rwlock; in dng_pthread_rwlock_tryrdlock()
968 dng_pthread_rwlock_trywrlock(dng_pthread_rwlock_t *rwlock) dng_pthread_rwlock_trywrlock() argument
989 dng_pthread_rwlock_unlock(dng_pthread_rwlock_t *rwlock) dng_pthread_rwlock_unlock() argument
1029 dng_pthread_rwlock_wrlock(dng_pthread_rwlock_t *rwlock) dng_pthread_rwlock_wrlock() argument
[all...]

Completed in 9 milliseconds

123