Robert Haas <robertmhaas@gmail.com> writes:
> On Mon, Apr 18, 2016 at 10:27 AM, Andres Freund <andres@anarazel.de> wrote:
>> Personally I think the "spin" part is actually quite relevant, and I
>> think we shouldn't loose it. It describes concurrency and blocking
>> behaviour, and how errors need to be handled (i.e. there may not be
>> any).
> IMHO, "buffer header lock bit" is plenty clear enough. We could say
> "buffer header spin lock bit" but I think that's too many words and
> not actually more clear.
I agree. If it's just a bit, it pretty much has to be a spin lock,
because there's no way for it to contain any infrastructure that would
support anything else. In any case, you could and should document the
exact semantics in a comment associated with the declaration of that
bit field. It's not really necessary to repeat them in every reference,
so long as the references use a unique name that won't be confused with
other possible locking mechanisms. (From that standpoint, "header lock
bit" might be actively better than anything including the phrase "spin
lock", since it reduces the chance of confusion with s_lock.h.)
regards, tom lane