1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-21 00:42:43 +03:00

Refactor how InitProcess is called

The order of process initialization steps is now more consistent
between !EXEC_BACKEND and EXEC_BACKEND modes. InitProcess() is called
at the same place in either mode. We can now also move the
AttachSharedMemoryStructs() call into InitProcess() itself. This
reduces the number of "#ifdef EXEC_BACKEND" blocks.

Reviewed-by: Tristan Partin, Andres Freund, Alexander Lakhin
Discussion: https://www.postgresql.org/message-id/7a59b073-5b5b-151e-7ed3-8b01ff7ce9ef@iki.fi
This commit is contained in:
Heikki Linnakangas
2023-12-03 16:39:18 +02:00
parent 388491f1e5
commit fd5e8b440d
5 changed files with 35 additions and 63 deletions

View File

@@ -97,12 +97,9 @@ AuxiliaryProcessMain(AuxProcType auxtype)
*/
/*
* Create a PGPROC so we can use LWLocks. In the EXEC_BACKEND case, this
* was already done by SubPostmasterMain().
* Create a PGPROC so we can use LWLocks and access shared memory.
*/
#ifndef EXEC_BACKEND
InitAuxiliaryProcess();
#endif
BaseInit();