mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-21 22:07:01 +08:00
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
34 lines
974 B
C
34 lines
974 B
C
/*-------------------------------------------------------------------------
|
|
*
|
|
* logicalworker.h
|
|
* Exports for logical replication workers.
|
|
*
|
|
* Portions Copyright (c) 2016-2025, PostgreSQL Global Development Group
|
|
*
|
|
* src/include/replication/logicalworker.h
|
|
*
|
|
*-------------------------------------------------------------------------
|
|
*/
|
|
#ifndef LOGICALWORKER_H
|
|
#define LOGICALWORKER_H
|
|
|
|
#include <signal.h>
|
|
|
|
extern PGDLLIMPORT volatile sig_atomic_t ParallelApplyMessagePending;
|
|
|
|
extern void ApplyWorkerMain(Datum main_arg);
|
|
extern void ParallelApplyWorkerMain(Datum main_arg);
|
|
extern void TablesyncWorkerMain(Datum main_arg);
|
|
|
|
extern bool IsLogicalWorker(void);
|
|
extern bool IsLogicalParallelApplyWorker(void);
|
|
|
|
extern void HandleParallelApplyMessageInterrupt(void);
|
|
extern void ProcessParallelApplyMessages(void);
|
|
|
|
extern void LogicalRepWorkersWakeupAtCommit(Oid subid);
|
|
|
|
extern void AtEOXact_LogicalRepWorkers(bool isCommit);
|
|
|
|
#endif /* LOGICALWORKER_H */
|