Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 01 Apr 2003 11:44:06 -0500 (EST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Mark Murray <mark@grondar.org>
Cc:        arch@FreeBSD.org
Subject:   Re: #include <sys/lock.h> and <sys/mutex.h>
Message-ID:  <XFMail.20030401114406.jhb@FreeBSD.org>
In-Reply-To: <200304011622.h31GMM4j036254@grimreaper.grondar.org>

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

On 01-Apr-2003 Mark Murray wrote:
> John Baldwin writes:
>> >>Do you need the whole sys/lock.h and sys/mutex.h? Can you get by with
>> >>#including sys/_lock.h and/or sys/_mutex.h in sys/bio.h? And possibly
>> >>following up by adding the non-underscore variants in the hopefully
>> >>few places where they are actually needed.
>> > 
>> > I can probably get away with the _* versions, but I'd prefer to know
>> > what our plans for this sort of situation actually is...
>> 
>> The _lock.h and _mutex.h were the plan and are suitable for nesting
>> in other headers such as sys/bio.h when needed.  sys/lock.h and sys/mutex.h
>> should only be included when you need the actual API's rather than just
>> the structure definitions.  As another argument, I wouldn't mind having
>> sys/mutex.h and sys/sx.h include sys/lock.h but I'm not sure bde@ would
>> like that.
> 
> Aren't we trying to remove sys/lock.h? If so, cant we move its contents
> elsewhere?

No.  sys/lock.h was renamed to sys/lockmgr.h.  Files using lockmgr()
should be including sys/lockmgr.h and not depending on the nested include
in sys/lock.h as that was only for backwards compat and should go away.
sys/lock.h defines things like struct lock_class and flags for struct
lock_object as well as prototypes for witness, etc.  Basically things
that are shared across lock primitive such as mutexes, sx, and eventually
lockmgr.

-- 

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



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