@ -4100,15 +4100,6 @@ BackendStartup(Port *port)
/* Perform additional initialization and collect startup packet */
BackendInitialize ( port ) ;
/*
* Create a per - backend PGPROC struct in shared memory . We must do
* this before we can use LWLocks . In the ! EXEC_BACKEND case ( here )
* this could be delayed a bit further , but EXEC_BACKEND needs to do
* stuff with LWLocks before PostgresMain ( ) , so we do it here as well
* for symmetry .
*/
InitProcess ( ) ;
/* And run the backend */
BackendRun ( port ) ;
}
@ -4419,6 +4410,12 @@ BackendInitialize(Port *port)
static void
BackendRun ( Port * port )
{
/*
* Create a per - backend PGPROC struct in shared memory . We must do this
* before we can use LWLocks or access any shared memory .
*/
InitProcess ( ) ;
/*
* Make sure we aren ' t in PostmasterContext anymore . ( We can ' t delete it
* just yet , though , because InitPostgres will need the HBA data . )
@ -4918,12 +4915,6 @@ SubPostmasterMain(int argc, char *argv[])
/* Restore basic shared memory pointers */
InitShmemAccess ( UsedShmemSegAddr ) ;
/* Need a PGPROC to run AttachSharedMemoryStructs */
InitProcess ( ) ;
/* Attach process to shared data structures */
AttachSharedMemoryStructs ( ) ;
/* And run the backend */
BackendRun ( port ) ; /* does not return */
}
@ -4936,12 +4927,6 @@ SubPostmasterMain(int argc, char *argv[])
/* Restore basic shared memory pointers */
InitShmemAccess ( UsedShmemSegAddr ) ;
/* Need a PGPROC to run AttachSharedMemoryStructs */
InitAuxiliaryProcess ( ) ;
/* Attach process to shared data structures */
AttachSharedMemoryStructs ( ) ;
auxtype = atoi ( argv [ 3 ] ) ;
AuxiliaryProcessMain ( auxtype ) ; /* does not return */
}
@ -4950,12 +4935,6 @@ SubPostmasterMain(int argc, char *argv[])
/* Restore basic shared memory pointers */
InitShmemAccess ( UsedShmemSegAddr ) ;
/* Need a PGPROC to run AttachSharedMemoryStructs */
InitProcess ( ) ;
/* Attach process to shared data structures */
AttachSharedMemoryStructs ( ) ;
AutoVacLauncherMain ( argc - 2 , argv + 2 ) ; /* does not return */
}
if ( strcmp ( argv [ 1 ] , " --forkavworker " ) = = 0 )
@ -4963,12 +4942,6 @@ SubPostmasterMain(int argc, char *argv[])
/* Restore basic shared memory pointers */
InitShmemAccess ( UsedShmemSegAddr ) ;
/* Need a PGPROC to run AttachSharedMemoryStructs */
InitProcess ( ) ;
/* Attach process to shared data structures */
AttachSharedMemoryStructs ( ) ;
AutoVacWorkerMain ( argc - 2 , argv + 2 ) ; /* does not return */
}
if ( strcmp ( argv [ 1 ] , " --forkbgworker " ) = = 0 )
@ -4979,12 +4952,6 @@ SubPostmasterMain(int argc, char *argv[])
/* Restore basic shared memory pointers */
InitShmemAccess ( UsedShmemSegAddr ) ;
/* Need a PGPROC to run AttachSharedMemoryStructs */
InitProcess ( ) ;
/* Attach process to shared data structures */
AttachSharedMemoryStructs ( ) ;
MyBgworkerEntry = worker ;
BackgroundWorkerMain ( ) ;
}