Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit637109d

Browse files
committed
Rename StartBackgroundWorker() to BackgroundWorkerMain().
The comment claimed that it is "called from postmaster", but it isactually called in the child process, pretty early in the processinitialization. I guess you could interpret "called from postmaster"to mean that, but it seems wrong to me. Rename the function to beconsistent with other functions with similar role.Reviewed-by: Thomas MunroDiscussion:https://www.postgresql.org/message-id/4f95c1fc-ad3c-7974-3a8c-6faa3931804c@iki.fi
1 parent0bbafb5 commit637109d

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

‎src/backend/postmaster/bgworker.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -741,13 +741,10 @@ bgworker_die(SIGNAL_ARGS)
741741
}
742742

743743
/*
744-
* Start a new background worker
745-
*
746-
* This is the main entry point for background worker, to be called from
747-
* postmaster.
744+
* Main entry point for background worker processes.
748745
*/
749746
void
750-
StartBackgroundWorker(void)
747+
BackgroundWorkerMain(void)
751748
{
752749
sigjmp_buflocal_sigjmp_buf;
753750
BackgroundWorker*worker=MyBgworkerEntry;

‎src/backend/postmaster/postmaster.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4982,7 +4982,7 @@ SubPostmasterMain(int argc, char *argv[])
49824982
shmem_slot=atoi(argv[1]+15);
49834983
MyBgworkerEntry=BackgroundWorkerEntry(shmem_slot);
49844984

4985-
StartBackgroundWorker();
4985+
BackgroundWorkerMain();
49864986
}
49874987
if (strcmp(argv[1],"--forklog")==0)
49884988
{
@@ -5721,7 +5721,7 @@ do_start_bgworker(RegisteredBgWorker *rw)
57215721
MemoryContextDelete(PostmasterContext);
57225722
PostmasterContext=NULL;
57235723

5724-
StartBackgroundWorker();
5724+
BackgroundWorkerMain();
57255725

57265726
exit(1);/* should not get here */
57275727
break;

‎src/include/postmaster/bgworker_internals.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ extern void BackgroundWorkerStopNotifications(pid_t pid);
5454
externvoidForgetUnstartedBackgroundWorkers(void);
5555
externvoidResetBackgroundWorkerCrashTimes(void);
5656

57-
/*Function to start abackground worker, called from postmaster.c */
58-
externvoidStartBackgroundWorker(void)pg_attribute_noreturn();
57+
/*Entry point forbackground worker processes */
58+
externvoidBackgroundWorkerMain(void)pg_attribute_noreturn();
5959

6060
#ifdefEXEC_BACKEND
6161
externBackgroundWorker*BackgroundWorkerEntry(intslotno);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp