Date: Wed, 13 Oct 1999 17:46:37 -0700 (PDT) From: Bill Studenmund <wrstuden@nas.nasa.gov> To: Zhihui Zhang <zzhang@cs.binghamton.edu> Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: The meaning of LK_INTERLOCK Message-ID: <Pine.SOL.3.96.991013173526.13849G-100000@marcy.nas.nasa.gov> In-Reply-To: <Pine.GSO.3.96.991013150703.13392A-100000@sol.cs.binghamton.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
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 majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SOL.3.96.991013173526.13849G-100000>