cvs commit: src/sys/dev/fxp if_fxp.c if_fxpvar.h

Dag-Erling Smorgrav des at ofug.org
Fri Apr 25 09:43:26 PDT 2003


John Baldwin <jhb at FreeBSD.org> writes:
> Agreed, locks should be protecting data structures, not code blocks.

Locks that protect code paths are called monitors and aren't very
useful except in OO languages.  I can't think of any cases in the
kernel where we would want to lock a code path; if anyone can think of
an example, I'm willing to bet that they're just deluding themselves
into thinking that a lock on a singleton object (or unique variable)
is actually a lock on the code that accesses it.

DES
-- 
Dag-Erling Smorgrav - des at ofug.org


More information about the cvs-src mailing list