On 3 July 2014 16:59, Simon Riggs <si...@2ndquadrant.com> wrote:

>
> I think we should say this though
>
> LockBufHdr(buf);
> valid = ((buf->flags & BM_VALID) != 0);
> if (valid)
>     PinBuffer_Locked(buf);
> else
>     UnlockBufHdr(buf);
>
> since otherwise we would access the buffer flags without the spinlock
> and we would leak a pin if the buffer was not valid
>

Ah right. That is essential.

Reply via email to