From: Robert Haas Date: Fri, 16 Aug 2013 19:28:03 +0000 (-0400) Subject: Rename some bgworker functions as we've done in master. X-Git-Tag: REL9_3_RC1~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8e2eca46dbd3bb8efa56ef0aebd60eadcbcc5dd4;p=postgresql Rename some bgworker functions as we've done in master. Commit 2dee7998f93062e2ae7fcc9048ff170e528d1724 renames these functions in master, for consistency; per discussion, backport just the renaming portion of that commit to 9.3 to keep the branches in sync. Michael Paquier --- diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index 75f2f82548..b94851a281 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -401,7 +401,7 @@ static int GetNumRegisteredBackgroundWorkers(int flags); 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); @@ -426,7 +426,7 @@ static bool SignalUnconnectedWorkers(int signal); 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); @@ -1251,7 +1251,7 @@ PostmasterMain(int argc, char *argv[]) pmState = PM_STARTUP; /* Some workers may be scheduled to start now */ - StartOneBackgroundWorker(); + maybe_start_bgworker(); status = ServerLoop(); @@ -1656,7 +1656,7 @@ ServerLoop(void) /* 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 @@ -2596,7 +2596,7 @@ reaper(SIGNAL_ARGS) 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, @@ -4567,7 +4567,7 @@ SubPostmasterMain(int argc, char *argv[]) cookie = atoi(argv[1] + 15); MyBgworkerEntry = find_bgworker_entry(cookie); - do_start_bgworker(); + StartBackgroundWorker(); } if (strcmp(argv[1], "--forkarch") == 0) { @@ -4670,7 +4670,7 @@ sigusr1_handler(SIGNAL_ARGS) pmState = PM_HOT_STANDBY; /* Some workers may be scheduled to start now */ - StartOneBackgroundWorker(); + maybe_start_bgworker(); } if (CheckPostmasterSignal(PMSIGNAL_WAKEN_ARCHIVER) && @@ -5382,7 +5382,7 @@ bgworker_sigusr1_handler(SIGNAL_ARGS) } static void -do_start_bgworker(void) +StartBackgroundWorker(void) { sigjmp_buf local_sigjmp_buf; char buf[MAXPGPATH]; @@ -5573,7 +5573,7 @@ bgworker_forkexec(int cookie) * 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; @@ -5604,7 +5604,7 @@ start_bgworker(RegisteredBgWorker *rw) /* Do NOT release postmaster's working memory context */ MyBgworkerEntry = &rw->rw_worker; - do_start_bgworker(); + StartBackgroundWorker(); break; #endif default: @@ -5708,7 +5708,7 @@ assign_backendlist_entry(RegisteredBgWorker *rw) * system state requires it. */ static void -StartOneBackgroundWorker(void) +maybe_start_bgworker(void) { slist_iter iter; TimestampTz now = 0; @@ -5776,7 +5776,7 @@ StartOneBackgroundWorker(void) 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) {