From dbe941827eab53194eda5cd350a4e1414f192658 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Thu, 13 Jun 2013 18:41:21 -0400 Subject: [PATCH] liblockdep: Add pthread_rwlock_t test suite A simple test to make sure we handle rwlocks correctly. Signed-off-by: Sasha Levin Signed-off-by: Peter Zijlstra 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 --- tools/lib/lockdep/tests/WW.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tools/lib/lockdep/tests/WW.c 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 + +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); +} -- 2.30.2