mirror of
https://github.com/torvalds/linux.git
synced 2026-11-24 07:22:34 +00:00
This is a rather simple and basic test suite to test common locking issues. Beyond tests, it also shows how to use the library. Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Peter Zijlstra <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
13 lines
257 B
C
13 lines
257 B
C
#ifndef _LIBLOCKDEP_TEST_COMMON_H
|
|
#define _LIBLOCKDEP_TEST_COMMON_H
|
|
|
|
#define LOCK_UNLOCK_2(a, b) \
|
|
do { \
|
|
pthread_mutex_lock(&(a)); \
|
|
pthread_mutex_lock(&(b)); \
|
|
pthread_mutex_unlock(&(b)); \
|
|
pthread_mutex_unlock(&(a)); \
|
|
} while(0)
|
|
|
|
#endif
|