/* Wait to be signaled by UnpinBuffer() */
if (InHotStandby)
{
- /* Share the bufid that Startup process waits on */
+ /* Publish the bufid that Startup process waits on */
SetStartupBufferPinWaitBufId(buffer - 1);
/* Set alarm and then wait to be signaled by UnpinBuffer() */
ResolveRecoveryConflictWithBufferPin();
+ /* Reset the published bufid */
SetStartupBufferPinWaitBufId(-1);
}
else
*/
ProcGlobal->freeProcs = NULL;
ProcGlobal->autovacFreeProcs = NULL;
+ ProcGlobal->startupProc = NULL;
+ ProcGlobal->startupProcPid = 0;
+ ProcGlobal->startupBufferPinWaitBufId = -1;
ProcGlobal->spins_per_delay = DEFAULT_SPINS_PER_DELAY;
procglobal->startupProc = MyProc;
procglobal->startupProcPid = MyProcPid;
- procglobal->startupBufferPinWaitBufId = 0;
SpinLockRelease(ProcStructLock);
}
int
GetStartupBufferPinWaitBufId(void)
{
- int bufid;
-
/* use volatile pointer to prevent code rearrangement */
volatile PROC_HDR *procglobal = ProcGlobal;
- bufid = procglobal->startupBufferPinWaitBufId;
-
- return bufid;
+ return procglobal->startupBufferPinWaitBufId;
}
/*
/* The proc of the Startup process, since not in ProcArray */
PGPROC *startupProc;
int startupProcPid;
- /* Buffer id of the buffer that Startup process waits for pin on */
+ /* Buffer id of the buffer that Startup process waits for pin on, or -1 */
int startupBufferPinWaitBufId;
} PROC_HDR;