aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Conway <mail@joeconway.com>2020-06-05 16:49:32 -0400
committerJoe Conway <mail@joeconway.com>2020-06-05 16:49:32 -0400
commit3cbf4be3e0eb36ce9e433c5bb1f0517f69a3fecc (patch)
tree0a48d01dc29032af6de089b85bbeff029de53d48
parent6490376e56b09befe3d4e6792beb1d2328b61b44 (diff)
downloadpostgresql-3cbf4be3e0eb36ce9e433c5bb1f0517f69a3fecc.tar.gz
postgresql-3cbf4be3e0eb36ce9e433c5bb1f0517f69a3fecc.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 e167ee8fcbe..80241455357 100644
--- a/src/include/miscadmin.h
+++ b/src/include/miscadmin.h
@@ -97,16 +97,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 */