]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
liblockdep: Add pthread_rwlock_t test suite
authorSasha Levin <sasha.levin@oracle.com>
Thu, 13 Jun 2013 22:41:21 +0000 (18:41 -0400)
committerIngo Molnar <mingo@kernel.org>
Wed, 27 Nov 2013 10:55:24 +0000 (11:55 +0100)
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>
tools/lib/lockdep/tests/WW.c [new file with mode: 0644]

diff --git a/tools/lib/lockdep/tests/WW.c b/tools/lib/lockdep/tests/WW.c
new file mode 100644 (file)
index 0000000..d44f77d
--- /dev/null
@@ -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);
+}