Re: Little cleanup: Move ProcStructLock to the ProcGlobal struct

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>, Chao Li <li.evan.chao@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2026-02-11T15:29:00Z
Lists: pgsql-hackers
Heikki Linnakangas <hlinnaka@iki.fi> writes:
> On 11/02/2026 16:52, Tom Lane wrote:
>> This is not a great situation.  I wonder if we can put back some
>> mode that could be used by a few BF members to catch such oversights.

> Do we still support any architectures where initializing the spinlock to 
> all-zeros doesn't do the right thing? Could we accept that all-zeros is 
> a valid initialization of a spinlock?

I'm not terribly comfortable with that: it seems short-sighted.
Even today, on platforms where we use __sync_lock_test_and_set /
__sync_lock_release, the gcc manual does not quite promise that
the released state is all-zero.

			regards, tom lane



Commits

  1. Move ProcStructLock to the ProcGlobal struct