aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Conway <mail@joeconway.com>2020-06-05 16:49:28 -0400
committerJoe Conway <mail@joeconway.com>2020-06-05 16:49:28 -0400
commit8401ad52350e8a5f0bb71942f2ac7636969bf8f3 (patch)
treea8cf3aae82ce57ba6ecad8d20204f5eab340f7f4
parent022cd0bfd33968f2b004106cfeaa3b2951e7f322 (diff)
downloadpostgresql-8401ad52350e8a5f0bb71942f2ac7636969bf8f3.tar.gz
postgresql-8401ad52350e8a5f0bb71942f2ac7636969bf8f3.zip
Add unlikely() to CHECK_FOR_INTERRUPTS()
Add the unlikely() branch hint macro to CHECK_FOR_INTERRUPTS(). Backpatch to REL_10_STABLE where we first started using unlikely(). Discussion: https://www.postgresql.org/message-id/flat/8692553c-7fe8-17d9-cbc1-7cddb758f4c6%40joeconway.com
-rw-r--r--src/include/miscadmin.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h
index 61a24c2e3c6..f1e02714217 100644
--- a/src/include/miscadmin.h
+++ b/src/include/miscadmin.h
@@ -98,16 +98,16 @@ extern void ProcessInterrupts(void);
#define CHECK_FOR_INTERRUPTS() \
do { \
- if (InterruptPending) \
+ if (unlikely(InterruptPending)) \
ProcessInterrupts(); \
} while(0)
#else /* WIN32 */
#define CHECK_FOR_INTERRUPTS() \
do { \
- if (UNBLOCKED_SIGNAL_QUEUE()) \
+ if (unlikely(UNBLOCKED_SIGNAL_QUEUE())) \
pgwin32_dispatch_queued_signals(); \
- if (InterruptPending) \
+ if (unlikely(InterruptPending)) \
ProcessInterrupts(); \
} while(0)
#endif /* WIN32 */