Messages in this thread Patch in this message | | | From | Sasha Levin <> | Subject | [PATCH 6/9] liblockdep: Add pthread_rwlock_t test suite | Date | Tue, 30 Apr 2013 14:54:37 -0400 |
| |
A simple test to make sure we handle rwlocks correctly.
Signed-off-by: Sasha Levin <sasha.levin@oracle.com> --- 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 0000000..d44f77d --- /dev/null +++ b/tools/lib/lockdep/tests/WW.c @@ -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); +} -- 1.8.2.1
| |