summaryrefslogtreecommitdiff
path: root/kern/lock.c
diff options
context:
space:
mode:
Diffstat (limited to 'kern/lock.c')
-rw-r--r--kern/lock.c14
1 files changed, 13 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