PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
pmsignal.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * pmsignal.h
4  * routines for signaling the postmaster from its child processes
5  *
6  *
7  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/storage/pmsignal.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef PMSIGNAL_H
15 #define PMSIGNAL_H
16 
17 /*
18  * Reasons for signaling the postmaster. We can cope with simultaneous
19  * signals for different reasons. If the same reason is signaled multiple
20  * times in quick succession, however, the postmaster is likely to observe
21  * only one notification of it. This is okay for the present uses.
22  */
23 typedef enum
24 {
25  PMSIGNAL_RECOVERY_STARTED, /* recovery has started */
26  PMSIGNAL_BEGIN_HOT_STANDBY, /* begin Hot Standby */
27  PMSIGNAL_WAKEN_ARCHIVER, /* send a NOTIFY signal to xlog archiver */
28  PMSIGNAL_ROTATE_LOGFILE, /* send SIGUSR1 to syslogger to rotate logfile */
29  PMSIGNAL_START_AUTOVAC_LAUNCHER, /* start an autovacuum launcher */
30  PMSIGNAL_START_AUTOVAC_WORKER, /* start an autovacuum worker */
31  PMSIGNAL_BACKGROUND_WORKER_CHANGE, /* background worker state change */
32  PMSIGNAL_START_WALRECEIVER, /* start a walreceiver */
33  PMSIGNAL_ADVANCE_STATE_MACHINE, /* advance postmaster's state machine */
34 
35  NUM_PMSIGNALS /* Must be last value of enum! */
37 
38 /* PMSignalData is an opaque struct, details known only within pmsignal.c */
39 typedef struct PMSignalData PMSignalData;
40 
41 /*
42  * prototypes for functions in pmsignal.c
43  */
44 extern Size PMSignalShmemSize(void);
45 extern void PMSignalShmemInit(void);
46 extern void SendPostmasterSignal(PMSignalReason reason);
47 extern bool CheckPostmasterSignal(PMSignalReason reason);
48 extern int AssignPostmasterChildSlot(void);
49 extern bool ReleasePostmasterChildSlot(int slot);
50 extern bool IsPostmasterChildWalSender(int slot);
51 extern void MarkPostmasterChildActive(void);
52 extern void MarkPostmasterChildInactive(void);
53 extern void MarkPostmasterChildWalSender(void);
54 extern bool PostmasterIsAlive(void);
55 
56 #endif /* PMSIGNAL_H */
void PMSignalShmemInit(void)
Definition: pmsignal.c:95
Size PMSignalShmemSize(void)
Definition: pmsignal.c:80
bool CheckPostmasterSignal(PMSignalReason reason)
Definition: pmsignal.c:130
void MarkPostmasterChildActive(void)
Definition: pmsignal.c:223
bool IsPostmasterChildWalSender(int slot)
Definition: pmsignal.c:207
void MarkPostmasterChildInactive(void)
Definition: pmsignal.c:256
void SendPostmasterSignal(PMSignalReason reason)
Definition: pmsignal.c:113
bool PostmasterIsAlive(void)
Definition: pmsignal.c:272
int AssignPostmasterChildSlot(void)
Definition: pmsignal.c:151
size_t Size
Definition: c.h:356
void MarkPostmasterChildWalSender(void)
Definition: pmsignal.c:239
PMSignalReason
Definition: pmsignal.h:23
bool ReleasePostmasterChildSlot(int slot)
Definition: pmsignal.c:185