Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Apr 2002 03:17:52 -0500 (EST)
From:      "Andrew R. Reiter" <arr@FreeBSD.org>
To:        "Andrew R. Reiter" <arr@FreeBSD.org>
Cc:        Alfred Perlstein <bright@mu.org>, smp@FreeBSD.org
Subject:   Re: Where to initialize certain locks...
Message-ID:  <Pine.NEB.3.96L.1020402031510.18134K-100000@fledge.watson.org>
In-Reply-To: <Pine.NEB.3.96L.1020402025203.18134J-100000@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 2 Apr 2002, Andrew R. Reiter wrote:

: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:

Sorry to reply to my own post, but I feel it necesary to mention that I
dislike having to pass in sub and order... 

:
: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
:
:

--
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1020402031510.18134K-100000>