00001 /*------------------------------------------------------------------------- 00002 * 00003 * pmsignal.h 00004 * routines for signaling the postmaster from its child processes 00005 * 00006 * 00007 * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group 00008 * Portions Copyright (c) 1994, Regents of the University of California 00009 * 00010 * src/include/storage/pmsignal.h 00011 * 00012 *------------------------------------------------------------------------- 00013 */ 00014 #ifndef PMSIGNAL_H 00015 #define PMSIGNAL_H 00016 00017 /* 00018 * Reasons for signaling the postmaster. We can cope with simultaneous 00019 * signals for different reasons. If the same reason is signaled multiple 00020 * times in quick succession, however, the postmaster is likely to observe 00021 * only one notification of it. This is okay for the present uses. 00022 */ 00023 typedef enum 00024 { 00025 PMSIGNAL_RECOVERY_STARTED, /* recovery has started */ 00026 PMSIGNAL_BEGIN_HOT_STANDBY, /* begin Hot Standby */ 00027 PMSIGNAL_WAKEN_ARCHIVER, /* send a NOTIFY signal to xlog archiver */ 00028 PMSIGNAL_ROTATE_LOGFILE, /* send SIGUSR1 to syslogger to rotate logfile */ 00029 PMSIGNAL_START_AUTOVAC_LAUNCHER, /* start an autovacuum launcher */ 00030 PMSIGNAL_START_AUTOVAC_WORKER, /* start an autovacuum worker */ 00031 PMSIGNAL_START_WALRECEIVER, /* start a walreceiver */ 00032 PMSIGNAL_ADVANCE_STATE_MACHINE, /* advance postmaster's state machine */ 00033 00034 NUM_PMSIGNALS /* Must be last value of enum! */ 00035 } PMSignalReason; 00036 00037 /* PMSignalData is an opaque struct, details known only within pmsignal.c */ 00038 typedef struct PMSignalData PMSignalData; 00039 00040 /* 00041 * prototypes for functions in pmsignal.c 00042 */ 00043 extern Size PMSignalShmemSize(void); 00044 extern void PMSignalShmemInit(void); 00045 extern void SendPostmasterSignal(PMSignalReason reason); 00046 extern bool CheckPostmasterSignal(PMSignalReason reason); 00047 extern int AssignPostmasterChildSlot(void); 00048 extern bool ReleasePostmasterChildSlot(int slot); 00049 extern bool IsPostmasterChildWalSender(int slot); 00050 extern void MarkPostmasterChildActive(void); 00051 extern void MarkPostmasterChildInactive(void); 00052 extern void MarkPostmasterChildWalSender(void); 00053 extern bool PostmasterIsAlive(void); 00054 00055 #endif /* PMSIGNAL_H */