From f31d09974779144113570ae1799c033ad751cf98 Mon Sep 17 00:00:00 2001 From: rwatson Date: Mon, 29 Mar 2004 17:00:05 +0000 Subject: If debug.mpsafenet, initialize UNIX domain socket timeouts as MPSAFE; otherwise, assert Giant in the callouts. --- sys/kern/uipc_domain.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'sys/kern/uipc_domain.c') diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c index 33a21c5..b94c114 100644 --- a/sys/kern/uipc_domain.c +++ b/sys/kern/uipc_domain.c @@ -134,8 +134,13 @@ domaininit(void *dummy) if (max_linkhdr < 16) /* XXX */ max_linkhdr = 16; - callout_init(&pffast_callout, 0); - callout_init(&pfslow_callout, 0); + if (debug_mpsafenet) { + callout_init(&pffast_callout, CALLOUT_MPSAFE); + callout_init(&pfslow_callout, CALLOUT_MPSAFE); + } else { + callout_init(&pffast_callout, 0); + callout_init(&pfslow_callout, 0); + } callout_reset(&pffast_callout, 1, pffasttimo, NULL); callout_reset(&pfslow_callout, 1, pfslowtimo, NULL); @@ -236,6 +241,8 @@ pfslowtimo(arg) register struct domain *dp; register struct protosw *pr; + NET_ASSERT_GIANT(); + for (dp = domains; dp; dp = dp->dom_next) for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) if (pr->pr_slowtimo) @@ -250,6 +257,8 @@ pffasttimo(arg) register struct domain *dp; register struct protosw *pr; + NET_ASSERT_GIANT(); + for (dp = domains; dp; dp = dp->dom_next) for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) if (pr->pr_fasttimo) -- cgit v1.1