Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Fix !DIAGNOSTIC builds.
details: https://anonhg.NetBSD.org/src/rev/095cd402baa8
branches: trunk
changeset: 995493:095cd402baa8
user: kre <kre%NetBSD.org@localhost>
date: Tue Dec 25 02:17:07 2018 +0000
description:
Fix !DIAGNOSTIC builds.
diffstat:
sys/kern/kern_threadpool.c | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diffs (49 lines):
diff -r 94c93987ee4f -r 095cd402baa8 sys/kern/kern_threadpool.c
--- a/sys/kern/kern_threadpool.c Tue Dec 25 00:35:26 2018 +0000
+++ b/sys/kern/kern_threadpool.c Tue Dec 25 02:17:07 2018 +0000
@@ -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 @@
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 @@
return EBUSY;
} while (atomic_cas_uint(&job->job_refcnt, refcnt, (refcnt + 1))
!= refcnt);
-
+
return 0;
}
Home |
Main Index |
Thread Index |
Old Index