mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-09-04 20:19:47 +08:00 
			
		
		
		
	 886adbed7a
			
		
	
	
		886adbed7a
		
	
	
	
	
		
			
			This patch makes sure that the lockdep_reset_lock() function gets tested. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Johannes Berg <johannes@sipsolutions.net> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Sasha Levin <sasha.levin@oracle.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Waiman Long <longman@redhat.com> Cc: johannes.berg@intel.com Cc: tj@kernel.org Link: https://lkml.kernel.org/r/20181207011148.251812-8-bvanassche@acm.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
		
			
				
	
	
		
			24 lines
		
	
	
		
			463 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			463 B
		
	
	
	
		
			C
		
	
	
	
	
	
| // SPDX-License-Identifier: GPL-2.0
 | |
| #include <liblockdep/mutex.h>
 | |
| #include "common.h"
 | |
| 
 | |
| void main(void)
 | |
| {
 | |
| 	pthread_mutex_t a, b, c, d;
 | |
| 
 | |
| 	pthread_mutex_init(&a, NULL);
 | |
| 	pthread_mutex_init(&b, NULL);
 | |
| 	pthread_mutex_init(&c, NULL);
 | |
| 	pthread_mutex_init(&d, NULL);
 | |
| 
 | |
| 	LOCK_UNLOCK_2(a, b);
 | |
| 	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);
 | |
| }
 |