sysmon_task_queue_sched needs to RUN_ONCE(tq_preinit) as well, it can

be called from sysmon_envsys_register() early.
This commit is contained in:
martin 2015-04-28 11:58:49 +00:00
parent 8bcb30da14
commit 7bd37d6abf
1 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: sysmon_taskq.c,v 1.18 2015/04/27 07:51:28 pgoyette Exp $ */ /* $NetBSD: sysmon_taskq.c,v 1.19 2015/04/28 11:58:49 martin Exp $ */
/* /*
* Copyright (c) 2001, 2003 Wasabi Systems, Inc. * Copyright (c) 2001, 2003 Wasabi Systems, Inc.
@ -41,7 +41,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sysmon_taskq.c,v 1.18 2015/04/27 07:51:28 pgoyette Exp $"); __KERNEL_RCSID(0, "$NetBSD: sysmon_taskq.c,v 1.19 2015/04/28 11:58:49 martin Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/malloc.h> #include <sys/malloc.h>
@ -212,6 +212,8 @@ sysmon_task_queue_sched(u_int pri, void (*func)(void *), void *arg)
{ {
struct sysmon_task *st, *lst; struct sysmon_task *st, *lst;
(void)RUN_ONCE(&once_tq, tq_preinit);
if (sysmon_task_queue_lwp == NULL) if (sysmon_task_queue_lwp == NULL)
aprint_debug("WARNING: Callback scheduled before sysmon " aprint_debug("WARNING: Callback scheduled before sysmon "
"task queue thread present\n"); "task queue thread present\n");