Module Name:    src
Committed By:   ozaki-r
Date:           Tue Jan 16 08:15:29 UTC 2018

Modified Files:
        src/sys/kern: kern_timeout.c

Log Message:
Sanity-check if interlock is held when it's passed


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/kern/kern_timeout.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/kern_timeout.c
diff -u src/sys/kern/kern_timeout.c:1.53 src/sys/kern/kern_timeout.c:1.54
--- src/sys/kern/kern_timeout.c:1.53	Tue Jan  9 01:44:50 2018
+++ src/sys/kern/kern_timeout.c	Tue Jan 16 08:15:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_timeout.c,v 1.53 2018/01/09 01:44:50 christos Exp $	*/
+/*	$NetBSD: kern_timeout.c,v 1.54 2018/01/16 08:15:29 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_timeout.c,v 1.53 2018/01/09 01:44:50 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_timeout.c,v 1.54 2018/01/16 08:15:29 ozaki-r Exp $");
 
 /*
  * Timeouts are kept in a hierarchical timing wheel.  The c_time is the
@@ -473,6 +473,7 @@ callout_halt(callout_t *cs, void *interl
 
 	KASSERT(c->c_magic == CALLOUT_MAGIC);
 	KASSERT(!cpu_intr_p());
+	KASSERT(interlock == NULL || mutex_owned(interlock));
 
 	lock = callout_lock(c);
 	relock = NULL;

Reply via email to