Home
last modified time | relevance | path

Searched refs:rwlock (Results 1 - 25 of 92) sorted by relevance

1234

/kernel/liteos_a/kernel/base/ipc/
H A Dlos_rwlock.c43 BOOL LOS_RwlockIsValid(const LosRwlock *rwlock) in LOS_RwlockIsValid() argument
45 if ((rwlock != NULL) && ((rwlock->magic & RWLOCK_COUNT_MASK) == OS_RWLOCK_MAGIC)) { in LOS_RwlockIsValid()
52 UINT32 LOS_RwlockInit(LosRwlock *rwlock) in LOS_RwlockInit() argument
56 if (rwlock == NULL) { in LOS_RwlockInit()
61 if ((rwlock->magic & RWLOCK_COUNT_MASK) == OS_RWLOCK_MAGIC) { in LOS_RwlockInit()
66 rwlock->rwCount = 0; in LOS_RwlockInit()
67 rwlock->writeOwner = NULL; in LOS_RwlockInit()
68 LOS_ListInit(&(rwlock->readList)); in LOS_RwlockInit()
69 LOS_ListInit(&(rwlock in LOS_RwlockInit()
75 LOS_RwlockDestroy(LosRwlock *rwlock) LOS_RwlockDestroy() argument
99 OsRwlockCheck(const LosRwlock *rwlock) OsRwlockCheck() argument
130 OsRwlockRdPendOp(LosTaskCB *runTask, LosRwlock *rwlock, UINT32 timeout) OsRwlockRdPendOp() argument
174 OsRwlockWrPendOp(LosTaskCB *runTask, LosRwlock *rwlock, UINT32 timeout) OsRwlockWrPendOp() argument
215 OsRwlockRdUnsafe(LosRwlock *rwlock, UINT32 timeout) OsRwlockRdUnsafe() argument
224 OsRwlockTryRdUnsafe(LosRwlock *rwlock, UINT32 timeout) OsRwlockTryRdUnsafe() argument
253 OsRwlockWrUnsafe(LosRwlock *rwlock, UINT32 timeout) OsRwlockWrUnsafe() argument
262 OsRwlockTryWrUnsafe(LosRwlock *rwlock, UINT32 timeout) OsRwlockTryWrUnsafe() argument
282 LOS_RwlockRdLock(LosRwlock *rwlock, UINT32 timeout) LOS_RwlockRdLock() argument
297 LOS_RwlockTryRdLock(LosRwlock *rwlock) LOS_RwlockTryRdLock() argument
312 LOS_RwlockWrLock(LosRwlock *rwlock, UINT32 timeout) LOS_RwlockWrLock() argument
327 LOS_RwlockTryWrLock(LosRwlock *rwlock) LOS_RwlockTryWrLock() argument
363 OsRwlockPostOp(LosRwlock *rwlock, BOOL *needSched) OsRwlockPostOp() argument
409 OsRwlockUnlockUnsafe(LosRwlock *rwlock, BOOL *needSched) OsRwlockUnlockUnsafe() argument
441 LOS_RwlockUnLock(LosRwlock *rwlock) LOS_RwlockUnLock() argument
[all...]
/third_party/mesa3d/src/util/
H A Drwlock.h44 SRWLOCK rwlock; member
46 pthread_rwlock_t rwlock;
50 static inline int u_rwlock_init(struct u_rwlock *rwlock) in u_rwlock_init() argument
53 InitializeSRWLock(&rwlock->rwlock); in u_rwlock_init()
56 return pthread_rwlock_init(&rwlock->rwlock, NULL); in u_rwlock_init()
60 static inline int u_rwlock_destroy(struct u_rwlock *rwlock) in u_rwlock_destroy() argument
65 return pthread_rwlock_destroy(&rwlock->rwlock); in u_rwlock_destroy()
69 u_rwlock_rdlock(struct u_rwlock *rwlock) u_rwlock_rdlock() argument
79 u_rwlock_rdunlock(struct u_rwlock *rwlock) u_rwlock_rdunlock() argument
89 u_rwlock_wrlock(struct u_rwlock *rwlock) u_rwlock_wrlock() argument
99 u_rwlock_wrunlock(struct u_rwlock *rwlock) u_rwlock_wrunlock() argument
[all...]
/kernel/linux/linux-6.6/include/linux/
H A Drwlock_rt.h10 extern void __rt_rwlock_init(rwlock_t *rwlock, const char *name,
13 static inline void __rt_rwlock_init(rwlock_t *rwlock, char *name, in __rt_rwlock_init() argument
27 extern void rt_read_lock(rwlock_t *rwlock);
28 extern int rt_read_trylock(rwlock_t *rwlock);
29 extern void rt_read_unlock(rwlock_t *rwlock);
30 extern void rt_write_lock(rwlock_t *rwlock);
31 extern void rt_write_lock_nested(rwlock_t *rwlock, int subclass);
32 extern int rt_write_trylock(rwlock_t *rwlock);
33 extern void rt_write_unlock(rwlock_t *rwlock);
35 static __always_inline void read_lock(rwlock_t *rwlock) in read_lock() argument
40 read_lock_bh(rwlock_t *rwlock) read_lock_bh() argument
46 read_lock_irq(rwlock_t *rwlock) read_lock_irq() argument
60 read_unlock(rwlock_t *rwlock) read_unlock() argument
65 read_unlock_bh(rwlock_t *rwlock) read_unlock_bh() argument
71 read_unlock_irq(rwlock_t *rwlock) read_unlock_irq() argument
76 read_unlock_irqrestore(rwlock_t *rwlock, unsigned long flags) read_unlock_irqrestore() argument
82 write_lock(rwlock_t *rwlock) write_lock() argument
88 write_lock_nested(rwlock_t *rwlock, int subclass) write_lock_nested() argument
96 write_lock_bh(rwlock_t *rwlock) write_lock_bh() argument
102 write_lock_irq(rwlock_t *rwlock) write_lock_irq() argument
126 write_unlock(rwlock_t *rwlock) write_unlock() argument
131 write_unlock_bh(rwlock_t *rwlock) write_unlock_bh() argument
137 write_unlock_irq(rwlock_t *rwlock) write_unlock_irq() argument
142 write_unlock_irqrestore(rwlock_t *rwlock, unsigned long flags) write_unlock_irqrestore() argument
[all...]
H A Drwlock.h9 * rwlock related methods
39 # define do_raw_read_lock(rwlock) do {__acquire(lock); arch_read_lock(&(rwlock)->raw_lock); } while (0)
40 # define do_raw_read_trylock(rwlock) arch_read_trylock(&(rwlock)->raw_lock)
41 # define do_raw_read_unlock(rwlock) do {arch_read_unlock(&(rwlock)->raw_lock); __release(lock); } while (0)
42 # define do_raw_write_lock(rwlock) do {__acquire(lock); arch_write_lock(&(rwlock)->raw_lock); } while (0)
43 # define do_raw_write_trylock(rwlock) arch_write_tryloc
[all...]
/third_party/libuv/test/
H A Dtest-mutexes.c30 static uv_rwlock_t rwlock; variable
33 /* The mutex and rwlock tests are really poor.
74 uv_rwlock_t rwlock; in TEST_IMPL() local
77 r = uv_rwlock_init(&rwlock); in TEST_IMPL()
80 uv_rwlock_rdlock(&rwlock); in TEST_IMPL()
81 uv_rwlock_rdunlock(&rwlock); in TEST_IMPL()
82 uv_rwlock_wrlock(&rwlock); in TEST_IMPL()
83 uv_rwlock_wrunlock(&rwlock); in TEST_IMPL()
84 uv_rwlock_destroy(&rwlock); in TEST_IMPL()
114 ASSERT_EQ(UV_EBUSY, uv_rwlock_tryrdlock(&rwlock)); in thread_rwlock_trylock_peer()
[all...]
/third_party/musl/libc-test/src/functionalext/supplement/thread/
H A Dpthread_rwlock_timedrdlock.c24 * @tc.desc : Provide correct parameters, test timeout and rwlock
30 pthread_rwlock_t rwlock; in pthread_rwlock_timedrdlock_0100() local
31 pthread_rwlock_init(&rwlock, NULL); in pthread_rwlock_timedrdlock_0100()
37 rev = pthread_rwlock_timedrdlock(&rwlock, &ts); in pthread_rwlock_timedrdlock_0100()
41 pthread_rwlock_unlock(&rwlock); in pthread_rwlock_timedrdlock_0100()
43 pthread_rwlock_destroy(&rwlock); in pthread_rwlock_timedrdlock_0100()
48 * @tc.desc : In the locked (read lock) state, the test times out and rwlock
54 pthread_rwlock_t rwlock; in pthread_rwlock_timedrdlock_0200() local
55 pthread_rwlock_init(&rwlock, NULL); in pthread_rwlock_timedrdlock_0200()
56 int rev = pthread_rwlock_timedrdlock(&rwlock, NUL in pthread_rwlock_timedrdlock_0200()
78 pthread_rwlock_t rwlock; pthread_rwlock_timedrdlock_0300() local
102 pthread_rwlock_t rwlock; pthread_rwlock_timedrdlock_time64_0100() local
[all...]
H A Dpthread_rwlock_timedwrlock.c24 * @tc.desc : Provide correct parameters, test timeout and rwlock
30 pthread_rwlock_t rwlock; in pthread_rwlock_timedwrlock_0100() local
31 pthread_rwlock_init(&rwlock, NULL); in pthread_rwlock_timedwrlock_0100()
37 rev = pthread_rwlock_timedwrlock(&rwlock, &ts); in pthread_rwlock_timedwrlock_0100()
41 pthread_rwlock_unlock(&rwlock); in pthread_rwlock_timedwrlock_0100()
43 pthread_rwlock_destroy(&rwlock); in pthread_rwlock_timedwrlock_0100()
48 * @tc.desc : In the locked (read lock) state, the test times out and rwlock
54 pthread_rwlock_t rwlock; in pthread_rwlock_timedwrlock_0200() local
55 pthread_rwlock_init(&rwlock, NULL); in pthread_rwlock_timedwrlock_0200()
56 int rev = pthread_rwlock_timedrdlock(&rwlock, NUL in pthread_rwlock_timedwrlock_0200()
78 pthread_rwlock_t rwlock; pthread_rwlock_timedwrlock_0300() local
102 pthread_rwlock_t rwlock; pthread_rwlock_timedwrlock_time64_0100() local
[all...]
H A Dpthread_rwlock_tryrdlock.c26 pthread_rwlock_t rwlock; in pthread_rwlock_tryrdlock_0100() local
29 pthread_rwlock_init(&rwlock, &rwlockattr); in pthread_rwlock_tryrdlock_0100()
31 int ret = pthread_rwlock_tryrdlock(&rwlock); in pthread_rwlock_tryrdlock_0100()
33 ret = pthread_rwlock_unlock(&rwlock); in pthread_rwlock_tryrdlock_0100()
36 pthread_rwlock_destroy(&rwlock); in pthread_rwlock_tryrdlock_0100()
47 pthread_rwlock_t rwlock; in pthread_rwlock_tryrdlock_0200() local
50 pthread_rwlock_init(&rwlock, &rwlockattr); in pthread_rwlock_tryrdlock_0200()
52 int ret = pthread_rwlock_wrlock(&rwlock); in pthread_rwlock_tryrdlock_0200()
55 ret = pthread_rwlock_tryrdlock(&rwlock); in pthread_rwlock_tryrdlock_0200()
58 ret = pthread_rwlock_unlock(&rwlock); in pthread_rwlock_tryrdlock_0200()
[all...]
H A Dpthread_rwlock_trywrlock.c26 pthread_rwlock_t rwlock; in pthread_rwlock_trywrlock_0100() local
29 pthread_rwlock_init(&rwlock, &rwlockattr); in pthread_rwlock_trywrlock_0100()
31 int ret = pthread_rwlock_trywrlock(&rwlock); in pthread_rwlock_trywrlock_0100()
33 ret = pthread_rwlock_unlock(&rwlock); in pthread_rwlock_trywrlock_0100()
36 pthread_rwlock_destroy(&rwlock); in pthread_rwlock_trywrlock_0100()
47 pthread_rwlock_t rwlock; in pthread_rwlock_trywrlock_0200() local
50 pthread_rwlock_init(&rwlock, &rwlockattr); in pthread_rwlock_trywrlock_0200()
52 int ret = pthread_rwlock_wrlock(&rwlock); in pthread_rwlock_trywrlock_0200()
55 ret = pthread_rwlock_trywrlock(&rwlock); in pthread_rwlock_trywrlock_0200()
58 ret = pthread_rwlock_unlock(&rwlock); in pthread_rwlock_trywrlock_0200()
[all...]
/kernel/linux/linux-5.10/tools/lib/lockdep/
H A Dpreload.c64 /* pthread rwlock API */
67 extern int __pthread_rwlock_init(pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr);
68 extern int __pthread_rwlock_destroy(pthread_rwlock_t *rwlock);
69 extern int __pthread_rwlock_wrlock(pthread_rwlock_t *rwlock);
70 extern int __pthread_rwlock_trywrlock(pthread_rwlock_t *rwlock);
71 extern int __pthread_rwlock_rdlock(pthread_rwlock_t *rwlock);
72 extern int __pthread_rwlock_tryrdlock(pthread_rwlock_t *rwlock);
73 extern int __pthread_rwlock_unlock(pthread_rwlock_t *rwlock);
84 static int (*ll_pthread_rwlock_init)(pthread_rwlock_t *rwlock,
86 static int (*ll_pthread_rwlock_destroy)(pthread_rwlock_t *rwlock)
326 pthread_rwlock_init(pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr) pthread_rwlock_init() argument
340 pthread_rwlock_destroy(pthread_rwlock_t *rwlock) pthread_rwlock_destroy() argument
349 pthread_rwlock_rdlock(pthread_rwlock_t *rwlock) pthread_rwlock_rdlock() argument
363 pthread_rwlock_tryrdlock(pthread_rwlock_t *rwlock) pthread_rwlock_tryrdlock() argument
377 pthread_rwlock_trywrlock(pthread_rwlock_t *rwlock) pthread_rwlock_trywrlock() argument
391 pthread_rwlock_wrlock(pthread_rwlock_t *rwlock) pthread_rwlock_wrlock() argument
405 pthread_rwlock_unlock(pthread_rwlock_t *rwlock) pthread_rwlock_unlock() argument
[all...]
/third_party/skia/third_party/externals/swiftshader/third_party/llvm-10.0/llvm/lib/Support/
H A DRWMutex.cpp44 pthread_rwlock_t* rwlock =
49 bzero(rwlock, sizeof(pthread_rwlock_t));
52 // Initialize the rwlock
53 int errorcode = pthread_rwlock_init(rwlock, nullptr);
58 data_ = rwlock;
64 pthread_rwlock_t* rwlock = static_cast<pthread_rwlock_t*>(data_);
65 assert(rwlock != nullptr);
66 pthread_rwlock_destroy(rwlock);
67 free(rwlock);
73 pthread_rwlock_t* rwlock
[all...]
/kernel/linux/linux-6.6/kernel/locking/
H A Dspinlock_rt.c192 * The common functions which get wrapped into the rwlock API.
194 int __sched rt_read_trylock(rwlock_t *rwlock) in rt_read_trylock() argument
198 ret = rwbase_read_trylock(&rwlock->rwbase); in rt_read_trylock()
200 rwlock_acquire_read(&rwlock->dep_map, 0, 1, _RET_IP_); in rt_read_trylock()
208 int __sched rt_write_trylock(rwlock_t *rwlock) in rt_write_trylock() argument
212 ret = rwbase_write_trylock(&rwlock->rwbase); in rt_write_trylock()
214 rwlock_acquire(&rwlock->dep_map, 0, 1, _RET_IP_); in rt_write_trylock()
222 void __sched rt_read_lock(rwlock_t *rwlock) in rt_read_lock() argument
225 rwlock_acquire_read(&rwlock->dep_map, 0, 0, _RET_IP_); in rt_read_lock()
226 rwbase_read_lock(&rwlock in rt_read_lock()
232 rt_write_lock(rwlock_t *rwlock) rt_write_lock() argument
243 rt_write_lock_nested(rwlock_t *rwlock, int subclass) rt_write_lock_nested() argument
254 rt_read_unlock(rwlock_t *rwlock) rt_read_unlock() argument
263 rt_write_unlock(rwlock_t *rwlock) rt_write_unlock() argument
273 __rt_rwlock_init(rwlock_t *rwlock, const char *name, struct lock_class_key *key) __rt_rwlock_init() argument
[all...]
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/
H A D1-1.c7 * 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
33 static pthread_rwlock_t rwlock; variable
[all...]
/third_party/node/deps/openssl/openssl/crypto/
H A Dthreads_win.c44 CRYPTO_win_rwlock *rwlock; in CRYPTO_THREAD_lock_new() local
48 rwlock = lock; in CRYPTO_THREAD_lock_new()
49 InitializeSRWLock(&rwlock->lock); in CRYPTO_THREAD_lock_new()
74 CRYPTO_win_rwlock *rwlock = lock; in CRYPTO_THREAD_read_lock() local
76 AcquireSRWLockShared(&rwlock->lock); in CRYPTO_THREAD_read_lock()
86 CRYPTO_win_rwlock *rwlock = lock; in CRYPTO_THREAD_write_lock() local
88 AcquireSRWLockExclusive(&rwlock->lock); in CRYPTO_THREAD_write_lock()
89 rwlock->exclusive = 1; in CRYPTO_THREAD_write_lock()
99 CRYPTO_win_rwlock *rwlock = lock; in CRYPTO_THREAD_unlock() local
101 if (rwlock in CRYPTO_THREAD_unlock()
[all...]
/third_party/openssl/crypto/
H A Dthreads_win.c44 CRYPTO_win_rwlock *rwlock; in CRYPTO_THREAD_lock_new() local
48 rwlock = lock; in CRYPTO_THREAD_lock_new()
49 InitializeSRWLock(&rwlock->lock); in CRYPTO_THREAD_lock_new()
74 CRYPTO_win_rwlock *rwlock = lock; in CRYPTO_THREAD_read_lock() local
76 AcquireSRWLockShared(&rwlock->lock); in CRYPTO_THREAD_read_lock()
86 CRYPTO_win_rwlock *rwlock = lock; in CRYPTO_THREAD_write_lock() local
88 AcquireSRWLockExclusive(&rwlock->lock); in CRYPTO_THREAD_write_lock()
89 rwlock->exclusive = 1; in CRYPTO_THREAD_write_lock()
99 CRYPTO_win_rwlock *rwlock = lock; in CRYPTO_THREAD_unlock() local
101 if (rwlock in CRYPTO_THREAD_unlock()
[all...]
/kernel/liteos_a/kernel/include/
H A Dlos_rwlock.h54 INT32 rwCount : 8; /**< Times of locking the rwlock, rwCount > 0 when rwkick is read mode, rwCount < 0
55 when the rwlock is write mode, rwCount = 0 when the lock is free. */
56 VOID *writeOwner; /**< The current write thread that is locking the rwlock */
61 extern BOOL LOS_RwlockIsValid(const LosRwlock *rwlock);
65 * @brief Init a rwlock.
68 * This API is used to Init a rwlock. A rwlock handle is assigned to rwlockHandle when the rwlock is init successfully.
70 * @param rwlock [IN] Handle pointer of the successfully init rwlock
[all...]
/third_party/skia/third_party/externals/dng_sdk/source/
H A Ddng_pthread.h130 int dng_pthread_rwlock_destroy(dng_pthread_rwlock_t * rwlock);
131 int dng_pthread_rwlock_init(dng_pthread_rwlock_t * rwlock, const pthread_rwlockattr_t * attrs);
132 int dng_pthread_rwlock_rdlock(dng_pthread_rwlock_t * rwlock);
133 int dng_pthread_rwlock_tryrdlock(dng_pthread_rwlock_t * rwlock);
134 int dng_pthread_rwlock_trywrlock(dng_pthread_rwlock_t * rwlock);
135 int dng_pthread_rwlock_unlock(dng_pthread_rwlock_t * rwlock);
136 int dng_pthread_rwlock_wrlock(dng_pthread_rwlock_t * rwlock);
141 int dng_pthread_rwlock_destroy(dng_pthread_rwlock_t * rwlock);
142 int dng_pthread_rwlock_init(dng_pthread_rwlock_t * rwlock, const pthread_rwlockattr_t * attrs);
143 int dng_pthread_rwlock_rdlock(dng_pthread_rwlock_t * rwlock);
[all...]
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_tryrdlock/
H A D1-1.c7 * 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'
34 static pthread_rwlock_t rwlock; variable
53 rc = pthread_rwlock_tryrdlock(&rwlock); in fn_rd_1()
[all...]
/kernel/linux/linux-5.10/include/linux/
H A Drwlock.h9 * rwlock related methods
50 # define do_raw_read_lock(rwlock) do {__acquire(lock); arch_read_lock(&(rwlock)->raw_lock); } while (0)
53 # define do_raw_read_trylock(rwlock) arch_read_trylock(&(rwlock)->raw_lock)
54 # define do_raw_read_unlock(rwlock) do {arch_read_unlock(&(rwlock)->raw_lock); __release(lock); } while (0)
55 # define do_raw_write_lock(rwlock) do {__acquire(lock); arch_write_lock(&(rwlock)->raw_lock); } while (0)
58 # define do_raw_write_trylock(rwlock) arch_write_tryloc
[all...]
/kernel/linux/linux-5.10/tools/lib/lockdep/include/liblockdep/
H A Drwlock.h9 pthread_rwlock_t rwlock; member
17 .rwlock = PTHREAD_RWLOCK_INITIALIZER, \
28 return pthread_rwlock_init(&lock->rwlock, attr); in __rwlock_init()
41 return pthread_rwlock_rdlock(&lock->rwlock); in liblockdep_pthread_rwlock_rdlock()
48 return pthread_rwlock_unlock(&lock->rwlock); in liblockdep_pthread_rwlock_unlock()
54 return pthread_rwlock_wrlock(&lock->rwlock); in liblockdep_pthread_rwlock_wrlock()
60 return pthread_rwlock_tryrdlock(&lock->rwlock) == 0 ? 1 : 0; in liblockdep_pthread_rwlock_tryrdlock()
66 return pthread_rwlock_trywrlock(&lock->rwlock) == 0 ? 1 : 0; in liblockdep_pthread_rwlock_trywrlock()
71 return pthread_rwlock_destroy(&lock->rwlock); in liblockdep_rwlock_destroy()
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/
H A D1-1.c7 * 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'
32 static pthread_rwlock_t rwlock; variable
[all...]
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_wrlock/
H A D1-1.c7 * 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'
31 static pthread_rwlock_t rwlock; global() variable
[all...]
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/
H A D3-1.c13 * 1. Initialize a pthread_rwlock_t object 'rwlock' with pthread_rwlock_init()
27 static pthread_rwlock_t rwlock; variable
39 if (pthread_rwlock_init(&rwlock, &rwlockattr) != 0) { in main()
45 if (pthread_rwlock_rdlock(&rwlock) != 0) { in main()
52 if (pthread_rwlock_unlock(&rwlock) != 0) { in main()
59 if (pthread_rwlock_wrlock(&rwlock) != 0) { in main()
66 if (pthread_rwlock_unlock(&rwlock) != 0) { in main()
74 if (pthread_rwlock_destroy(&rwlock) != 0) { in main()
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/
H A D5-1.c7 * Test that pthread_rwlock_timedrdlock(pthread_rwlock_t *rwlock)
15 * 2. Child thread lock 'rwlock' for reading with pthread_rwlock_timedrdlock(),
17 * 3. The child thread unlocks the 'rwlock' and exits.
19 * 4. The child thread lock 'rwlock' for reading, with pthread_rwlock_timedrdlock(),
45 pthread_rwlock_t rwlock; in fn_rd_1() local
47 if (pthread_rwlock_init(&rwlock, NULL) != 0) { in fn_rd_1()
59 rc = pthread_rwlock_timedrdlock(&rwlock, &abs_timeout); in fn_rd_1()
67 if (pthread_rwlock_unlock(&rwlock) != 0) { in fn_rd_1()
76 if (pthread_rwlock_destroy(&rwlock) != 0) { in fn_rd_1()
90 pthread_rwlock_t rwlock; in fn_rd_2() local
[all...]
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/
H A D5-1.c7 * Test that pthread_rwlock_timedwrlock(pthread_rwlock_t *rwlock)
15 * 2. Child thread lock 'rwlock' for writing with pthread_rwlock_timedwrlock(),
17 * 3. The child thread unlocks the 'rwlock' and exit.
19 * 5. The child thread lock 'rwlock' for write, with pthread_rwlock_timedwrlock(),
52 pthread_rwlock_t rwlock; in fn_wr_1() local
54 if (pthread_rwlock_init(&rwlock, NULL) != 0) { in fn_wr_1()
66 rc = pthread_rwlock_timedwrlock(&rwlock, &abs_timeout); in fn_wr_1()
74 if (pthread_rwlock_unlock(&rwlock) != 0) { in fn_wr_1()
83 if (pthread_rwlock_destroy(&rwlock) != 0) { in fn_wr_1()
97 pthread_rwlock_t rwlock; in fn_wr_2() local
[all...]

Completed in 8 milliseconds

1234