[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1359694058-24452-6-git-send-email-sasha.levin@oracle.com>
Date: Thu, 31 Jan 2013 23:47:36 -0500
From: Sasha Levin <sasha.levin@...cle.com>
To: mingo@...hat.com, peterz@...radead.org
Cc: paulus@...ba.org, acme@...stprotocols.net, penberg@...nel.org,
linux-kernel@...r.kernel.org, Sasha Levin <sasha.levin@...cle.com>
Subject: [PATCH 5/7] liblock: rwlock test suite
A simple test to make sure we handle rwlocks correctly.
Signed-off-by: Sasha Levin <sasha.levin@...cle.com>
---
tools/lib/liblock/tests/WW.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
create mode 100644 tools/lib/liblock/tests/WW.c
diff --git a/tools/lib/liblock/tests/WW.c b/tools/lib/liblock/tests/WW.c
new file mode 100644
index 0000000..f2d00bd
--- /dev/null
+++ b/tools/lib/liblock/tests/WW.c
@@ -0,0 +1,16 @@
+#include <liblock/rwlock.h>
+
+void main(void)
+{
+ liblock_pthread_rwlock_t a, b;
+
+ liblock_init();
+ liblock_set_thread();
+
+ liblock_pthread_rwlock_init(&a, NULL);
+ liblock_pthread_rwlock_init(&b, NULL);
+
+ liblock_pthread_rwlock_wrlock(&a);
+ liblock_pthread_rwlock_rdlock(&b);
+ liblock_pthread_rwlock_wrlock(&a);
+}
--
1.8.1.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists