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

Lines changed: 3 additions & 3 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy