Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 May 2002 09:03:40 -0400 (EDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Terry Lambert <tlambert2@mindspring.com>
Cc:        net@FreeBSD.org, current@FreeBSD.org, "Kenneth D. Merry" <ken@kdm.org>, Alfred Perlstein <bright@mu.org>
Subject:   Re: new zero copy sockets patches available
Message-ID:  <XFMail.20020518090340.jhb@FreeBSD.org>
In-Reply-To: <3CE61A25.61C789FA@mindspring.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On 18-May-2002 Terry Lambert wrote:
> Alfred Perlstein wrote:
>> * Kenneth D. Merry <ken@kdm.org> [020517 23:31] wrote:
>> > The problem here is that the mutex needs to be initialized before I can
>> > acquire it, and there's going to be a race between checking to see
>> > whether it has been initialized and actually initializing it.
>> >
>> ...
>> > Suggestions?
>> 
>> *slaps forhead*
>> 
>> Probably a SYSINIT?
> 
> God, it's annoying that a statically declared mutex is not
> defacto initialized.

Is it in solaris?

> Yeah, I understand the "witness" crap (if it's there); that
> doesn't make it any less annoying.
> 
> Actually, a linker set (not a SYSINIT) could fix that... you
> would still need one sysinit to do the linkage of the statically
> declared structures, but it's at least doable.

a SYSINIT just is a linker set, and there is a convenience SYSINIT
MTX_SYSINIT() or what not that just registers a sysinit to initialize
a mutex.

-- 

John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20020518090340.jhb>