summaryrefslogtreecommitdiff
path: root/tools/lib/lockdep/tests
diff options
context:
space:
mode:
authorSasha Levin <sasha.levin@oracle.com>2013-06-14 02:41:21 +0400
committerIngo Molnar <mingo@kernel.org>2013-11-27 14:55:24 +0400
commitdbe941827eab53194eda5cd350a4e1414f192658 (patch)
treebf185ad613f38ba7d015b0d8d0277a4a4d7d3707 /tools/lib/lockdep/tests
parent5a52c9b480e09a782618dbf08de57f9ca54c8b49 (diff)
downloadlinux-dbe941827eab53194eda5cd350a4e1414f192658.tar.xz
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/tests')
-rw-r--r--tools/lib/lockdep/tests/WW.c13
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);
+}