1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-14 02:22:38 +03:00

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
This commit is contained in:
Heikki Linnakangas
2024-11-01 13:47:20 +02:00
parent e819bbb7c8
commit a9c546a5a3
11 changed files with 72 additions and 55 deletions

View File

@@ -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);
}
}
/*