diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2025-03-05 16:22:26 +0200 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2025-03-05 16:22:26 +0200 |
commit | 635f580120b99f6df71d7c12749b22acde61c5ad (patch) | |
tree | c9426b1738ae53c81ba419aa5f2dafff0ba6be32 /src/backend/postmaster/checkpointer.c | |
parent | f4e53e10b6ce0eedeb98caa4356facb47c7bb9cb (diff) | |
download | postgresql-635f580120b99f6df71d7c12749b22acde61c5ad.tar.gz postgresql-635f580120b99f6df71d7c12749b22acde61c5ad.zip |
Rename some signal and interrupt handling functions for consistency
The usual pattern for handling a signal is that the signal handler
sets a flag and calls SetLatch(MyLatch), and CHECK_FOR_INTERRUPTS() or
other code that is part of a wait loop calls another function to deal
with it. The naming of the functions involved was a bit inconsistent,
however. CHECK_FOR_INTERRUPTS() calls ProcessInterrupts() to do the
heavy-lifting, but the analogous functions in aux processes were
called HandleMainLoopInterrupts(), HandleStartupProcInterrupts(),
etc. Similarly, most subroutines of ProcessInterrupts() were called
Process*(), but some were called Handle*().
To make things less confusing, rename all the functions that are part
of the overall signal/interrupt handling system but are not executed
in a signal handler to e.g. ProcessSomething(), rather than
HandleSomething(). The "Process" prefix is now consistently used in
the non-signal-handler functions, and the "Handle" prefix in functions
that are part of signal handlers, except for some completely unrelated
functions that clearly have nothing to do with signal or interrupt
handling.
Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>
Discussion: https://www.postgresql.org/message-id/8a384b26-1499-41f6-be33-64b801fb98b8@iki.fi
Diffstat (limited to 'src/backend/postmaster/checkpointer.c')
-rw-r--r-- | src/backend/postmaster/checkpointer.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/postmaster/checkpointer.c b/src/backend/postmaster/checkpointer.c index 7acbbd3e267..0e228d143a0 100644 --- a/src/backend/postmaster/checkpointer.c +++ b/src/backend/postmaster/checkpointer.c @@ -157,7 +157,7 @@ static pg_time_t last_xlog_switch_time; /* Prototypes for private functions */ -static void HandleCheckpointerInterrupts(void); +static void ProcessCheckpointerInterrupts(void); static void CheckArchiveTimeout(void); static bool IsCheckpointOnSchedule(double progress); static bool ImmediateCheckpointRequested(void); @@ -359,7 +359,7 @@ CheckpointerMain(const void *startup_data, size_t startup_data_len) */ AbsorbSyncRequests(); - HandleCheckpointerInterrupts(); + ProcessCheckpointerInterrupts(); if (ShutdownXLOGPending || ShutdownRequestPending) break; @@ -536,7 +536,7 @@ CheckpointerMain(const void *startup_data, size_t startup_data_len) * We may have received an interrupt during the checkpoint and the * latch might have been reset (e.g. in CheckpointWriteDelay). */ - HandleCheckpointerInterrupts(); + ProcessCheckpointerInterrupts(); if (ShutdownXLOGPending || ShutdownRequestPending) break; } @@ -615,7 +615,7 @@ CheckpointerMain(const void *startup_data, size_t startup_data_len) /* Clear any already-pending wakeups */ ResetLatch(MyLatch); - HandleCheckpointerInterrupts(); + ProcessCheckpointerInterrupts(); if (ShutdownRequestPending) break; @@ -634,7 +634,7 @@ CheckpointerMain(const void *startup_data, size_t startup_data_len) * Process any new interrupts. */ static void -HandleCheckpointerInterrupts(void) +ProcessCheckpointerInterrupts(void) { if (ProcSignalBarrierPending) ProcessProcSignalBarrier(); |