| From: | Heikki Linnakangas <hlinnaka(at)iki(dot)fi> |
|---|---|
| To: | Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> |
| Cc: | "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: Little cleanup: Move ProcStructLock to the ProcGlobal struct |
| Date: | 2026-02-11 15:02:47 |
| Message-ID: | 11adb849-bca6-42ea-addd-c3dbc7ba2187@iki.fi |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On 11/02/2026 13:51, Ashutosh Bapat wrote:
> On Wed, Feb 11, 2026 at 8:46 AM Chao Li <li(dot)evan(dot)chao(at)gmail(dot)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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Zsolt Parragi | 2026-02-11 15:04:02 | Improving GUC prefix ownership for extensions |
| Previous Message | Viktor Holmberg | 2026-02-11 14:54:55 | Re: ON CONFLICT DO SELECT (take 3) |