From: Sasha Levin Date: Thu, 13 Jun 2013 22:41:21 +0000 (-0400) Subject: liblockdep: Add pthread_rwlock_t test suite X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=dbe941827eab53194eda5cd350a4e1414f192658;p=linux-beck.git 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 --- 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); +}