mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
liblockdep: Add pthread_rwlock_t test suite
A simple test to make sure we handle rwlocks correctly. Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Peter Zijlstra <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
parent
5a52c9b480
commit
dbe941827e
1 changed files with 13 additions and 0 deletions
13
tools/lib/lockdep/tests/WW.c
Normal file
13
tools/lib/lockdep/tests/WW.c
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#include <liblockdep/rwlock.h>
|
||||
|
||||
void main(void)
|
||||
{
|
||||
pthread_rwlock_t a, b;
|
||||
|
||||
pthread_rwlock_init(&a, NULL);
|
||||
pthread_rwlock_init(&b, NULL);
|
||||
|
||||
pthread_rwlock_wrlock(&a);
|
||||
pthread_rwlock_rdlock(&b);
|
||||
pthread_rwlock_wrlock(&a);
|
||||
}
|
||||
Loading…
Reference in a new issue