Module Name:    src
Committed By:   kre
Date:           Tue Dec 25 02:17:07 UTC 2018

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

Log Message:
Fix !DIAGNOSTIC builds.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/kern/kern_threadpool.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_threadpool.c
diff -u src/sys/kern/kern_threadpool.c:1.1 src/sys/kern/kern_threadpool.c:1.2
--- src/sys/kern/kern_threadpool.c:1.1	Mon Dec 24 16:58:54 2018
+++ src/sys/kern/kern_threadpool.c	Tue Dec 25 02:17:07 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_threadpool.c,v 1.1 2018/12/24 16:58:54 thorpej Exp $	*/
+/*	$NetBSD: kern_threadpool.c,v 1.2 2018/12/25 02:17:07 kre Exp $	*/
 
 /*-
  * Copyright (c) 2014, 2018 The NetBSD Foundation, Inc.
@@ -81,7 +81,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_threadpool.c,v 1.1 2018/12/24 16:58:54 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_threadpool.c,v 1.2 2018/12/25 02:17:07 kre Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -102,13 +102,20 @@ __KERNEL_RCSID(0, "$NetBSD: kern_threadp
 
 static ONCE_DECL(threadpool_init_once)
 
+#ifdef DIAGNOSTIC
 #define	THREADPOOL_INIT()					\
 do {								\
 	int threadpool_init_error =				\
 	    RUN_ONCE(&threadpool_init_once, threadpools_init);	\
 	KASSERT(threadpool_init_error == 0);			\
 } while (/*CONSTCOND*/0)
-	
+#else
+#define	THREADPOOL_INIT()					\
+do {								\
+	RUN_ONCE(&threadpool_init_once, threadpools_init);	\
+} while (/*CONSTCOND*/0)
+#endif
+
 
 /* Data structures */
 
@@ -724,7 +731,7 @@ threadpool_job_hold(threadpool_job_impl_
 			return EBUSY;
 	} while (atomic_cas_uint(&job->job_refcnt, refcnt, (refcnt + 1))
 	    != refcnt);
-	
+
 	return 0;
 }
 

Reply via email to