summaryrefslogtreecommitdiffstats
path: root/tools/lib/lockdep/tests/WW.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lib/lockdep/tests/WW.c')
-rw-r--r--tools/lib/lockdep/tests/WW.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/lib/lockdep/tests/WW.c b/tools/lib/lockdep/tests/WW.c
new file mode 100644
index 000000000..eee88df7f
--- /dev/null
+++ b/tools/lib/lockdep/tests/WW.c
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0
+#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);
+}