On Wed, Jan 07, 2004 at 05:37:09PM -0500, Neil Conway wrote:
>
> - if a backend holds the BufMgrLock, it will never try to
> LWLockAcquire() a per-buffer meta data lock, due to the risk of
> deadlock (and the loss in concurrency if we got blocked waiting
> while still holding the BufMgrLock). Instead it does a
> LWLockConditionalAcquire() and handles an acquisition failure
> sanely
I can only see this work when you always check that you actually
got the right buffer after you locked the meta data. There is
nothing preventing an other backend from using it to for
something else in it between the time you release the BufMgrLock
and you lock the buffer's meta data.
Note that your PinBuffer() is now always called when you already
have the lock meta lock, which is probably a good idea or you're
going to make that function more complex that it should be. Just
say that it should hold the meta lock instead of the BufMgrLock
when it's called.
Kurt