diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2024-11-01 13:47:20 +0200 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2024-11-01 13:47:20 +0200 |
commit | a9c546a5a3783810a1b665f246fc6d0a596d0606 (patch) | |
tree | 24dd96745733f9a63f0a68d7c19773e64fa6a81d /src/backend/access/transam/xlog.c | |
parent | e819bbb7c82ac048ffd865ba3f2d2c4933923c77 (diff) | |
download | postgresql-a9c546a5a3783810a1b665f246fc6d0a596d0606.tar.gz postgresql-a9c546a5a3783810a1b665f246fc6d0a596d0606.zip |
Use ProcNumbers instead of direct Latch pointers to address other procs
This is in preparation for replacing Latches with a new abstraction.
That's still work in progress, but this seems a little tidier anyway,
so let's get this refactoring out of the way already.
Discussion: https://www.postgresql.org/message-id/391abe21-413e-4d91-a650-b663af49500c%40iki.fi
Diffstat (limited to 'src/backend/access/transam/xlog.c')
-rw-r--r-- | src/backend/access/transam/xlog.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 3ecaf181392..00fe8c8ae72 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -2671,8 +2671,14 @@ XLogSetAsyncXactLSN(XLogRecPtr asyncXactLSN) wakeup = true; } - if (wakeup && ProcGlobal->walwriterLatch) - SetLatch(ProcGlobal->walwriterLatch); + if (wakeup) + { + volatile PROC_HDR *procglobal = ProcGlobal; + ProcNumber walwriterProc = procglobal->walwriterProc; + + if (walwriterProc != INVALID_PROC_NUMBER) + SetLatch(&GetPGProcByNumber(walwriterProc)->procLatch); + } } /* |