diff options
author | Sasha Levin <sasha.levin@oracle.com> | 2013-06-13 18:41:21 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-11-27 11:55:24 +0100 |
commit | dbe941827eab53194eda5cd350a4e1414f192658 (patch) | |
tree | bf185ad613f38ba7d015b0d8d0277a4a4d7d3707 /tools/lib/lockdep | |
parent | 5a52c9b480e09a782618dbf08de57f9ca54c8b49 (diff) |
liblockdep: Add pthread_rwlock_t test suite
A simple test to make sure we handle rwlocks correctly.
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: torvalds@linux-foundation.org
Link: http://lkml.kernel.org/r/1371163284-6346-7-git-send-email-sasha.levin@oracle.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/lib/lockdep')
-rw-r--r-- | tools/lib/lockdep/tests/WW.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/lib/lockdep/tests/WW.c b/tools/lib/lockdep/tests/WW.c new file mode 100644 index 000000000000..d44f77d71029 --- /dev/null +++ b/tools/lib/lockdep/tests/WW.c @@ -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); +} |