@@ -283,27 +283,25 @@ InitProcGlobal(void)
283283void
284284InitProcess (void )
285285{
286- /* use volatile pointer to prevent code rearrangement */
287- volatile PROC_HDR * procglobal = ProcGlobal ;
288286 PGPROC * volatile * procgloballist ;
289287
290288 /*
291289 * ProcGlobal should be set up already (if we are a backend, we inherit
292290 * this by fork() or EXEC_BACKEND mechanism from the postmaster).
293291 */
294- if (procglobal == NULL )
292+ if (ProcGlobal == NULL )
295293 elog (PANIC , "proc header uninitialized" );
296294
297295 if (MyProc != NULL )
298296 elog (ERROR , "you already exist" );
299297
300298 /* Decide which list should supply our PGPROC. */
301299 if (IsAnyAutoVacuumProcess ())
302- procgloballist = & procglobal -> autovacFreeProcs ;
300+ procgloballist = & ProcGlobal -> autovacFreeProcs ;
303301 else if (IsBackgroundWorker )
304- procgloballist = & procglobal -> bgworkerFreeProcs ;
302+ procgloballist = & ProcGlobal -> bgworkerFreeProcs ;
305303 else
306- procgloballist = & procglobal -> freeProcs ;
304+ procgloballist = & ProcGlobal -> freeProcs ;
307305
308306 /*
309307 * Try to get a proc struct from the appropriate free list. If this
@@ -314,7 +312,7 @@ InitProcess(void)
314312 */
315313 SpinLockAcquire (ProcStructLock );
316314
317- set_spins_per_delay (procglobal -> spins_per_delay );
315+ set_spins_per_delay (ProcGlobal -> spins_per_delay );
318316
319317 MyProc = * procgloballist ;
320318
@@ -578,13 +576,10 @@ InitAuxiliaryProcess(void)
578576void
579577PublishStartupProcessInformation (void )
580578{
581- /* use volatile pointer to prevent code rearrangement */
582- volatile PROC_HDR * procglobal = ProcGlobal ;
583-
584579 SpinLockAcquire (ProcStructLock );
585580
586- procglobal -> startupProc = MyProc ;
587- procglobal -> startupProcPid = MyProcPid ;
581+ ProcGlobal -> startupProc = MyProc ;
582+ ProcGlobal -> startupProcPid = MyProcPid ;
588583
589584 SpinLockRelease (ProcStructLock );
590585}
@@ -627,12 +622,9 @@ HaveNFreeProcs(int n)
627622{
628623 PGPROC * proc ;
629624
630- /* use volatile pointer to prevent code rearrangement */
631- volatile PROC_HDR * procglobal = ProcGlobal ;
632-
633625 SpinLockAcquire (ProcStructLock );
634626
635- proc = procglobal -> freeProcs ;
627+ proc = ProcGlobal -> freeProcs ;
636628
637629 while (n > 0 && proc != NULL )
638630 {
@@ -772,8 +764,6 @@ RemoveProcFromArray(int code, Datum arg)
772764static void
773765ProcKill (int code , Datum arg )
774766{
775- /* use volatile pointer to prevent code rearrangement */
776- volatile PROC_HDR * procglobal = ProcGlobal ;
777767 PGPROC * proc ;
778768 PGPROC * volatile * procgloballist ;
779769
@@ -822,7 +812,7 @@ ProcKill(int code, Datum arg)
822812 * procgloballist = proc ;
823813
824814 /* Update shared estimate of spins_per_delay */
825- procglobal -> spins_per_delay = update_spins_per_delay (procglobal -> spins_per_delay );
815+ ProcGlobal -> spins_per_delay = update_spins_per_delay (ProcGlobal -> spins_per_delay );
826816
827817 SpinLockRelease (ProcStructLock );
828818
@@ -1644,9 +1634,6 @@ ProcSendSignal(int pid)
16441634
16451635 if (RecoveryInProgress ())
16461636 {
1647- /* use volatile pointer to prevent code rearrangement */
1648- volatile PROC_HDR * procglobal = ProcGlobal ;
1649-
16501637 SpinLockAcquire (ProcStructLock );
16511638
16521639 /*
@@ -1657,8 +1644,8 @@ ProcSendSignal(int pid)
16571644 * backend, so BackendPidGetProc() will not return any pid at all. So
16581645 * we remember the information for this special case.
16591646 */
1660- if (pid == procglobal -> startupProcPid )
1661- proc = procglobal -> startupProc ;
1647+ if (pid == ProcGlobal -> startupProcPid )
1648+ proc = ProcGlobal -> startupProc ;
16621649
16631650 SpinLockRelease (ProcStructLock );
16641651 }
0 commit comments