Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 87fb04a

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 044c99b commit 87fb04a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/include/miscadmin.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,16 @@ extern void ProcessInterrupts(void);
9898

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

106106
#define CHECK_FOR_INTERRUPTS() \
107107
do { \
108-
if (UNBLOCKED_SIGNAL_QUEUE()) \
108+
if (unlikely(UNBLOCKED_SIGNAL_QUEUE())) \
109109
pgwin32_dispatch_queued_signals(); \
110-
if (InterruptPending) \
110+
if (unlikely(InterruptPending)) \
111111
ProcessInterrupts(); \
112112
} while(0)
113113
#endif /* WIN32 */

0 commit comments

Comments
 (0)