Re: Little cleanup: Move ProcStructLock to the ProcGlobal struct - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Little cleanup: Move ProcStructLock to the ProcGlobal struct
Date
Msg-id 11adb849-bca6-42ea-addd-c3dbc7ba2187@iki.fi
Whole thread Raw
In response to Re: Little cleanup: Move ProcStructLock to the ProcGlobal struct  (Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>)
List pgsql-hackers
On 11/02/2026 13:51, Ashutosh Bapat wrote:
> On Wed, Feb 11, 2026 at 8:46 AM Chao Li <li.evan.chao@gmail.com> wrote:
>> I took a quick review. You moved ProcStructLock into PROC_HDR as freeProcsLock, and deleted:
>> ```
>> ProcStructLock = ShmemInitStruct(...);
>> SpinLockInit(ProcStructLock);
>> ```
>>
>> But I don’t see a replacement like SpinLockInit(&ProcGlobal->freeProcsLock);
> 
> Good catch. I think the spinlock needs to be initialized somewhere in
> the code block starting with
> /*
> * Initialize the data structures.
> */
> 
> I also checked many other shared structures which contain spinlocks in
> them. All of them embed the spinlock instead of pointer to the
> spinlock. This change looks inline with that.

Fixed the initialization and pushed. Thanks!

- Heikki




pgsql-hackers by date:

Previous
From: Viktor Holmberg
Date:
Subject: Re: ON CONFLICT DO SELECT (take 3)
Next
From: Zsolt Parragi
Date:
Subject: Improving GUC prefix ownership for extensions