diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-10-21 21:43:46 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-10-21 21:43:46 +0000 |
commit | 6aad07d270ca2ba42c3083daf7bd640c272ecd4c (patch) | |
tree | d7279cbc7c4d3f5ad1dca58f49efa024f6dc6072 /src/include/miscadmin.h | |
parent | fdff883aca7f13660d01e708f38bfb105c3c7872 (diff) | |
download | postgresql-6aad07d270ca2ba42c3083daf7bd640c272ecd4c.tar.gz postgresql-6aad07d270ca2ba42c3083daf7bd640c272ecd4c.zip |
Improve performance of CHECK_FOR_INTERRUPTS() macro on Windows by not doing
a kernel call unless there's some evidence of a pending signal. This should
bring its performance on Windows into line with the Unix version. Problem
diagnosis and patch by Qingqing Zhou. Minor stylistic tweaks by moi ...
if it's broken, it's my fault.
Diffstat (limited to 'src/include/miscadmin.h')
-rw-r--r-- | src/include/miscadmin.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h index a2a802cacce..10f75197550 100644 --- a/src/include/miscadmin.h +++ b/src/include/miscadmin.h @@ -13,7 +13,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/miscadmin.h,v 1.180 2005/10/15 02:49:41 momjian Exp $ + * $PostgreSQL: pgsql/src/include/miscadmin.h,v 1.181 2005/10/21 21:43:46 tgl Exp $ * * NOTES * some of the information in this file should be moved to other files. @@ -83,15 +83,17 @@ do { \ if (InterruptPending) \ ProcessInterrupts(); \ } while(0) + #else /* WIN32 */ #define CHECK_FOR_INTERRUPTS() \ do { \ - if (WaitForSingleObjectEx(pgwin32_signal_event,0,TRUE) == WAIT_OBJECT_0) \ - pgwin32_dispatch_queued_signals(); \ + if (UNBLOCKED_SIGNAL_QUEUE()) \ + pgwin32_check_queued_signals(); \ if (InterruptPending) \ ProcessInterrupts(); \ } while(0) + #endif /* WIN32 */ |