On Wed, 13 Oct 1999, Zhihui Zhang wrote:
>
> The comments say that the flag LK_INTERLOCK means "unlock passed simple
> lock after getting lk_interlock". Under what circumstances are we going to
> need two simple locks (release the first one after getting the second
> one)? I can not understand this easily from the source code.
>
> Any help is appreciated.
The idea is that the other interlock protects something whose value
determines if we want to grab the lock.
For example, vn_lock() grabs the vnode interlock and looks at v_flag. If
VXLOCK is clear, we then call VOP_LOCK. By doing this interlock trick, no
one can get in and modify the flags before we've entered the lock manager.
Take care,
Bill
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message