Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 01 Apr 2003 10:22:30 +0200
From:      Poul-Henning Kamp <phk@phk.freebsd.dk>
To:        arch@freebsd.org
Subject:   #include <sys/lock.h> and <sys/mutex.h>
Message-ID:  <31464.1049185350@critter.freebsd.dk>

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

As we progress down the path of SMPng we will need to include
<sys/lock.h> and <sys/mutex.h> in more and more files.

The current score, not counting nested include cases, they currently
are included approx 16% and 19% of all .c files under /sys.

My present predicament is that I will probably put a mutex in the
bio queue which is defined in <sys/bio.h>, and so far, I've found
20 .c files where I need to add <sys/lock.h> and <sys/mutex.h> and
I am not yet at a point where LINT compiles.

Do we have a plan for these in the future ?  I can see three obvious
options:

A) define them leaf #includes, and #include them from the majority of
   our .c files.

B) Include them nested from other .h files which need them, in my
   case <sys/bio.h>

C) Include them nested from a central .h file like <sys/kernel.h>

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.



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