Module Name:    src
Committed By:   pgoyette
Date:           Tue Jan  9 22:58:45 UTC 2018

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

Log Message:
KASSERT() that kthread_join()'s target is expecting to be joined.

As discussed on IRC.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/kern/kern_kthread.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_kthread.c
diff -u src/sys/kern/kern_kthread.c:1.42 src/sys/kern/kern_kthread.c:1.43
--- src/sys/kern/kern_kthread.c:1.42	Fri Apr 21 15:10:34 2017
+++ src/sys/kern/kern_kthread.c	Tue Jan  9 22:58:45 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_kthread.c,v 1.42 2017/04/21 15:10:34 christos Exp $	*/
+/*	$NetBSD: kern_kthread.c,v 1.43 2018/01/09 22:58:45 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2007, 2009 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_kthread.c,v 1.42 2017/04/21 15:10:34 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_kthread.c,v 1.43 2018/01/09 22:58:45 pgoyette Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -194,6 +194,7 @@ kthread_join(lwp_t *l)
 {
 
 	KASSERT((l->l_flag & LW_SYSTEM) != 0);
+	KASSERT((l->l_pflag & LP_MUSTJOIN) != 0);
 
 	/*
 	 * - Wait if some other thread has occupied the target.

Reply via email to