| 
									
										
										
										
											2006-01-09 15:59:20 -08:00
										 |  |  | #ifndef __LINUX_MUTEX_DEBUG_H
 | 
					
						
							|  |  |  | #define __LINUX_MUTEX_DEBUG_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-01-09 21:38:23 -08:00
										 |  |  | #include <linux/linkage.h>
 | 
					
						
							| 
									
										
										
										
											2006-07-03 00:24:55 -07:00
										 |  |  | #include <linux/lockdep.h>
 | 
					
						
							| 
									
										
										
										
											2006-01-09 21:38:23 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-01-09 15:59:20 -08:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Mutexes - debugging helpers: | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-07-03 00:24:33 -07:00
										 |  |  | #define __DEBUG_MUTEX_INITIALIZER(lockname)				\
 | 
					
						
							|  |  |  | 	, .magic = &lockname | 
					
						
							| 
									
										
										
										
											2006-01-09 15:59:20 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-07-03 00:24:55 -07:00
										 |  |  | #define mutex_init(mutex)						\
 | 
					
						
							|  |  |  | do {									\ | 
					
						
							|  |  |  | 	static struct lock_class_key __key;				\ | 
					
						
							|  |  |  | 									\ | 
					
						
							|  |  |  | 	__mutex_init((mutex), #mutex, &__key);				\ | 
					
						
							|  |  |  | } while (0) | 
					
						
							| 
									
										
										
										
											2006-01-09 15:59:20 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-02-13 15:03:15 -08:00
										 |  |  | extern void mutex_destroy(struct mutex *lock); | 
					
						
							| 
									
										
										
										
											2006-01-09 15:59:20 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | #endif
 |