Date: Tue, 2 Apr 2002 02:59:00 -0500 (EST) From: "Andrew R. Reiter" <arr@FreeBSD.org> To: Alfred Perlstein <bright@mu.org> Cc: "Andrew R. Reiter" <arr@FreeBSD.org>, smp@FreeBSD.org Subject: Re: Where to initialize certain locks... Message-ID: <Pine.NEB.3.96L.1020402025203.18134J-100000@fledge.watson.org> In-Reply-To: <20020402072411.GH93885@elvis.mu.org>
index | next in thread | previous in thread | raw e-mail
On Mon, 1 Apr 2002, Alfred Perlstein wrote:
:Your concern is valid, perhaps a macro that automagically makes
:a sysinit to init a mutex? Sort of like the "SYSCALL_MODULE_HELPER"
:stuff, but not as ugly?
:
How about something along the lines of:
void
mtx_sysinit(void *arg)
{
struct mtx_init *margs = arg;
mtx_init(margs->mtx, margs->desc, margs->opts)
}
#define MTX_SYSINIT(name, desc, lock, opts, sub, order) \
static struct margs name##_args { \
lock, \
desc, \
opts, \
}; \
SYSINIT(name##_sysinit, sub, order, mtx_sysinit, &name##_args)
--
Andrew R. Reiter
arr@watson.org
arr@FreeBSD.org
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-smp" in the body of the message
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1020402025203.18134J-100000>
