Skip to content

Commit c5262cf

Browse files
committed
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
1 parent 9a9ba4c commit c5262cf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/include/miscadmin.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,16 @@ extern void ProcessInterrupts(void);
9797

9898
#define CHECK_FOR_INTERRUPTS() \
9999
do { \
100-
if (InterruptPending) \
100+
if (unlikely(InterruptPending)) \
101101
ProcessInterrupts(); \
102102
} while(0)
103103
#else /* WIN32 */
104104

105105
#define CHECK_FOR_INTERRUPTS() \
106106
do { \
107-
if (UNBLOCKED_SIGNAL_QUEUE()) \
107+
if (unlikely(UNBLOCKED_SIGNAL_QUEUE())) \
108108
pgwin32_dispatch_queued_signals(); \
109-
if (InterruptPending) \
109+
if (unlikely(InterruptPending)) \
110110
ProcessInterrupts(); \
111111
} while(0)
112112
#endif /* WIN32 */

0 commit comments

Comments
 (0)