summaryrefslogtreecommitdiff
path: root/src/include/miscadmin.h
diff options
context:
space:
mode:
authorNeil Conway2004-02-08 22:28:57 +0000
committerNeil Conway2004-02-08 22:28:57 +0000
commitf06e79525a57ccbf54ae5d0b673cd904ca978d67 (patch)
tree88e84b43a0eaa593dffa0f454bfef23ce49cd9d2 /src/include/miscadmin.h
parent04e82e500868c3e8582f797d7b54a44fcc750a68 (diff)
Win32 signals cleanup. Patch by Magnus Hagander, with input from Claudio
Natoli and Bruce Momjian (and some cosmetic fixes from Neil Conway). Changes: - remove duplicate signal definitions from pqsignal.h - replace pqkill() with kill() and redefine kill() in Win32 - use ereport() in place of fprintf() in some error handling in pqsignal.c - export pg_queue_signal() and make use of it where necessary - add a console control handler for Ctrl-C and similar handling on Win32 - do WaitForSingleObjectEx() in CHECK_FOR_INTERRUPTS() on Win32; query cancelling should now work on Win32 - various other fixes and cleanups
Diffstat (limited to 'src/include/miscadmin.h')
-rw-r--r--src/include/miscadmin.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h
index 1f71a434c17..7e9a209331e 100644
--- a/src/include/miscadmin.h
+++ b/src/include/miscadmin.h
@@ -12,7 +12,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/miscadmin.h,v 1.151 2004/02/06 19:36:18 wieck Exp $
+ * $PostgreSQL: pgsql/src/include/miscadmin.h,v 1.152 2004/02/08 22:28:57 neilc Exp $
*
* NOTES
* some of the information in this file should be moved to
@@ -74,11 +74,21 @@ extern volatile uint32 CritSectionCount;
/* in postgres.c */
extern void ProcessInterrupts(void);
+#ifndef WIN32
#define CHECK_FOR_INTERRUPTS() \
do { \
if (InterruptPending) \
ProcessInterrupts(); \
} while(0)
+#else
+#define CHECK_FOR_INTERRUPTS() \
+do { \
+ WaitForSingleObjectEx(GetCurrentThread(),0,TRUE); \
+ if (InterruptPending) \
+ ProcessInterrupts(); \
+} while (0)
+#endif
+
#define HOLD_INTERRUPTS() (InterruptHoldoffCount++)