git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 044c99b)
Add unlikely() to CHECK_FOR_INTERRUPTS()
Fri, 5 Jun 2020 20:49:25 +0000 (16:49 -0400)
Fri, 5 Jun 2020 20:49:25 +0000 (16:49 -0400)
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


diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h
index 14fa127ab118aaa2f917fd02481c9b709b378c5e..18bc8a7b9045ca80802ae740a4e122e87e1abdda 100644 (file)
--- 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 */
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /