How to do proper locking

Julian Elischer julian at
Sat Aug 6 07:00:08 GMT 2005

Hans Petter Selasky wrote:
> On Friday 05 August 2005 19:29, John Baldwin wrote:

> Yes, you are right, but the problem is, that for most callback systems in the 
> kernel, there is no mechanism that will pre-lock some custom mutex before 
> calling the callback.

Not generally applicable to this case but for example the netgraph callout
wrappers handlle netgraph node locking so that teh called function can
assume the node it is working on has been locked.
It's not applicable because netgraph locking is "different"
to locking elsewhere in the kernel due to the nature of netgraph.
But havinng a specific callout wrapper for a subsystem
does give the ability to do such things.

More information about the freebsd-hackers mailing list