mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
tools/lib/lockdep/tests: Test the lockdep_reset_lock() implementation
This patch makes sure that the lockdep_reset_lock() function gets tested. Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Johannes Berg <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Sasha Levin <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Waiman Long <[email protected]> Cc: [email protected] Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
1 parent
ac862d9b2f
commit
886adbed7a
9 files changed
+30
No files matched your search
@@ -44,6 +44,7 @@ void lock_acquire(struct lockdep_map *lock, unsigned int subclass,
|
||||
struct lockdep_map *nest_lock, unsigned long ip);
|
||||
void lock_release(struct lockdep_map *lock, int nested,
|
||||
unsigned long ip);
|
||||
void lockdep_reset_lock(struct lockdep_map *lock);
|
||||
extern void debug_check_no_locks_freed(const void *from, unsigned long len);
|
||||
|
||||
#define STATIC_LOCKDEP_MAP_INIT(_name, _key) \
|
||||
|
||||
@@ -54,6 +54,7 @@ static inline int liblockdep_pthread_mutex_trylock(liblockdep_pthread_mutex_t *l
|
||||
|
||||
static inline int liblockdep_pthread_mutex_destroy(liblockdep_pthread_mutex_t *lock)
|
||||
{
|
||||
lockdep_reset_lock(&lock->dep_map);
|
||||
return pthread_mutex_destroy(&lock->mutex);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,4 +11,7 @@ void main(void)
|
||||
|
||||
LOCK_UNLOCK_2(a, b);
|
||||
LOCK_UNLOCK_2(b, a);
|
||||
|
||||
pthread_mutex_destroy(&b);
|
||||
pthread_mutex_destroy(&a);
|
||||
}
|
||||
@@ -13,4 +13,8 @@ void main(void)
|
||||
LOCK_UNLOCK_2(a, b);
|
||||
LOCK_UNLOCK_2(b, c);
|
||||
LOCK_UNLOCK_2(c, a);
|
||||
|
||||
pthread_mutex_destroy(&c);
|
||||
pthread_mutex_destroy(&b);
|
||||
pthread_mutex_destroy(&a);
|
||||
}
|
||||
@@ -15,4 +15,9 @@ void main(void)
|
||||
LOCK_UNLOCK_2(b, c);
|
||||
LOCK_UNLOCK_2(c, d);
|
||||
LOCK_UNLOCK_2(d, a);
|
||||
|
||||
pthread_mutex_destroy(&d);
|
||||
pthread_mutex_destroy(&c);
|
||||
pthread_mutex_destroy(&b);
|
||||
pthread_mutex_destroy(&a);
|
||||
}
|
||||
@@ -13,4 +13,8 @@ void main(void)
|
||||
LOCK_UNLOCK_2(a, b);
|
||||
LOCK_UNLOCK_2(c, a);
|
||||
LOCK_UNLOCK_2(b, c);
|
||||
|
||||
pthread_mutex_destroy(&c);
|
||||
pthread_mutex_destroy(&b);
|
||||
pthread_mutex_destroy(&a);
|
||||
}
|
||||
@@ -15,4 +15,9 @@ void main(void)
|
||||
LOCK_UNLOCK_2(c, d);
|
||||
LOCK_UNLOCK_2(b, c);
|
||||
LOCK_UNLOCK_2(d, a);
|
||||
|
||||
pthread_mutex_destroy(&d);
|
||||
pthread_mutex_destroy(&c);
|
||||
pthread_mutex_destroy(&b);
|
||||
pthread_mutex_destroy(&a);
|
||||
}
|
||||
@@ -15,4 +15,9 @@ void main(void)
|
||||
LOCK_UNLOCK_2(c, d);
|
||||
LOCK_UNLOCK_2(b, d);
|
||||
LOCK_UNLOCK_2(d, a);
|
||||
|
||||
pthread_mutex_destroy(&d);
|
||||
pthread_mutex_destroy(&c);
|
||||
pthread_mutex_destroy(&b);
|
||||
pthread_mutex_destroy(&a);
|
||||
}
|
||||
@@ -10,4 +10,6 @@ void main(void)
|
||||
pthread_mutex_lock(&a);
|
||||
pthread_mutex_unlock(&a);
|
||||
pthread_mutex_unlock(&a);
|
||||
|
||||
pthread_mutex_destroy(&a);
|
||||
}
|
||||
Reference in new issue
Block a user