static void StartupPacketTimeoutHandler(void);
static void CleanupBackend(int pid, int exitstatus);
static bool CleanupBackgroundWorker(int pid, int exitstatus);
-static void do_start_bgworker(void);
+static void StartBackgroundWorker(void);
static void HandleChildCrash(int pid, int exitstatus, const char *procname);
static void LogChildExit(int lev, const char *procname,
int pid, int exitstatus);
static int CountChildren(int target);
static int CountUnconnectedWorkers(void);
-static void StartOneBackgroundWorker(void);
+static void maybe_start_bgworker(void);
static bool CreateOptsFile(int argc, char *argv[], char *fullprogname);
static pid_t StartChildProcess(AuxProcType type);
static void StartAutovacuumWorker(void);
pmState = PM_STARTUP;
/* Some workers may be scheduled to start now */
- StartOneBackgroundWorker();
+ maybe_start_bgworker();
status = ServerLoop();
/* Get other worker processes running, if needed */
if (StartWorkerNeeded || HaveCrashedWorker)
- StartOneBackgroundWorker();
+ maybe_start_bgworker();
/*
* Touch Unix socket and lock files every 58 minutes, to ensure that
PgStatPID = pgstat_start();
/* some workers may be scheduled to start now */
- StartOneBackgroundWorker();
+ maybe_start_bgworker();
/* at this point we are really open for business */
ereport(LOG,
cookie = atoi(argv[1] + 15);
MyBgworkerEntry = find_bgworker_entry(cookie);
- do_start_bgworker();
+ StartBackgroundWorker();
}
if (strcmp(argv[1], "--forkarch") == 0)
{
pmState = PM_HOT_STANDBY;
/* Some workers may be scheduled to start now */
- StartOneBackgroundWorker();
+ maybe_start_bgworker();
}
if (CheckPostmasterSignal(PMSIGNAL_WAKEN_ARCHIVER) &&
}
static void
-do_start_bgworker(void)
+StartBackgroundWorker(void)
{
sigjmp_buf local_sigjmp_buf;
char buf[MAXPGPATH];
* This code is heavily based on autovacuum.c, q.v.
*/
static void
-start_bgworker(RegisteredBgWorker *rw)
+do_start_bgworker(RegisteredBgWorker *rw)
{
pid_t worker_pid;
/* Do NOT release postmaster's working memory context */
MyBgworkerEntry = &rw->rw_worker;
- do_start_bgworker();
+ StartBackgroundWorker();
break;
#endif
default:
* system state requires it.
*/
static void
-StartOneBackgroundWorker(void)
+maybe_start_bgworker(void)
{
slist_iter iter;
TimestampTz now = 0;
else
rw->rw_child_slot = MyPMChildSlot = AssignPostmasterChildSlot();
- start_bgworker(rw); /* sets rw->rw_pid */
+ do_start_bgworker(rw); /* sets rw->rw_pid */
if (rw->rw_backend)
{