diff options
Diffstat (limited to 'kern')
-rw-r--r-- | kern/lock.c | 14 | ||||
-rw-r--r-- | kern/lock.h | 6 |
2 files changed, 19 insertions, 1 deletions
diff --git a/kern/lock.c b/kern/lock.c index 3c74fec..d894b06 100644 --- a/kern/lock.c +++ b/kern/lock.c @@ -136,9 +136,21 @@ struct simple_locks_info { void *ra; } simple_locks_info[NSLINFO]; +int do_check_simple_locks = 1; + void check_simple_locks(void) { - assert(simple_locks_taken == 0); + assert(! do_check_simple_locks || simple_locks_taken == 0); +} + +void check_simple_locks_enable(void) +{ + do_check_simple_locks = 1; +} + +void check_simple_locks_disable(void) +{ + do_check_simple_locks = 0; } /* Need simple lock sanity checking code if simple locks are being diff --git a/kern/lock.h b/kern/lock.h index 435ee1d..0eba0ad 100644 --- a/kern/lock.h +++ b/kern/lock.h @@ -81,6 +81,8 @@ class simple_lock_data_t name; #define simple_lock_taken(lock) (simple_lock_assert(lock), \ 1) /* always succeeds */ #define check_simple_locks() +#define check_simple_locks_enable() +#define check_simple_locks_disable() #else /* NCPUS > 1 */ /* @@ -97,6 +99,8 @@ extern boolean_t simple_lock_try(simple_lock_t); (lock)->lock_data) extern void check_simple_locks(void); +extern void check_simple_locks_enable(void); +extern void check_simple_locks_disable(void); #endif /* NCPUS > 1 */ @@ -121,6 +125,8 @@ class struct simple_lock_data_empty name; #define simple_lock_taken(l) (simple_lock_assert(l), \ 1) /* always succeeds */ #define check_simple_locks() +#define check_simple_locks_enable() +#define check_simple_locks_disable() #define simple_lock_pause() #endif /* MACH_SLOCKS */ |