summaryrefslogtreecommitdiff
path: root/src/include/utils
diff options
context:
space:
mode:
authorTom Lane2001-01-14 05:08:17 +0000
committerTom Lane2001-01-14 05:08:17 +0000
commit36839c192706f5abd75bdcb02b6a7cace14ce108 (patch)
tree3022631b1208e1227684db86c12cbba7da15f611 /src/include/utils
parent027f144e390afa6f189270e8c2a2a56c0a88f646 (diff)
Restructure backend SIGINT/SIGTERM handling so that 'die' interrupts
are treated more like 'cancel' interrupts: the signal handler sets a flag that is examined at well-defined spots, rather than trying to cope with an interrupt that might happen anywhere. See pghackers discussion of 1/12/01.
Diffstat (limited to 'src/include/utils')
-rw-r--r--src/include/utils/elog.h35
1 files changed, 7 insertions, 28 deletions
diff --git a/src/include/utils/elog.h b/src/include/utils/elog.h
index da9178b2767..8468118177f 100644
--- a/src/include/utils/elog.h
+++ b/src/include/utils/elog.h
@@ -7,13 +7,14 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: elog.h,v 1.23 2001/01/12 21:54:01 tgl Exp $
+ * $Id: elog.h,v 1.24 2001/01/14 05:08:16 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef ELOG_H
#define ELOG_H
+/* Error level codes */
#define NOTICE 0 /* random info - no special action */
#define ERROR (-1) /* user error - return to known state */
#define FATAL 1 /* fatal error - abort process */
@@ -23,47 +24,25 @@
#define LOG DEBUG
#define NOIND (-3) /* debug message, don't indent as far */
+/* Configurable parameters */
#ifdef ENABLE_SYSLOG
extern int Use_syslog;
#endif
-
-/*
- * If CritSectionCount > 0, signal handlers mustn't do
- * elog(ERROR|FATAL), instead remember what action is
- * required with QueryCancel or ProcDiePending.
- * ProcDiePending will be honored at critical section exit,
- * but QueryCancel is only checked at specified points.
- */
-extern volatile uint32 CritSectionCount; /* duplicates access/xlog.h */
-extern volatile bool ProcDiePending;
-extern void ForceProcDie(void); /* in postgres.c */
-
-#define START_CRIT_SECTION() (CritSectionCount++)
-
-#define END_CRIT_SECTION() \
- do { \
- Assert(CritSectionCount > 0); \
- CritSectionCount--; \
- if (CritSectionCount == 0 && ProcDiePending) \
- ForceProcDie(); \
- } while(0)
-
extern bool Log_timestamp;
extern bool Log_pid;
+
#ifndef __GNUC__
-extern void elog(int lev, const char *fmt,...);
+extern void elog(int lev, const char *fmt, ...);
#else
/* This extension allows gcc to check the format string for consistency with
the supplied arguments. */
-extern void elog(int lev, const char *fmt,...) __attribute__((format(printf, 2, 3)));
+extern void elog(int lev, const char *fmt, ...)
+ __attribute__((format(printf, 2, 3)));
#endif
-#ifndef PG_STANDALONE
extern int DebugFileOpen(void);
-#endif
-
#endif /* ELOG_H */