diff options
author | Joe Conway <mail@joeconway.com> | 2020-06-05 16:49:35 -0400 |
---|---|---|
committer | Joe Conway <mail@joeconway.com> | 2020-06-05 16:49:35 -0400 |
commit | c5262cfd59cb0b1f1d2adb2131b9c1c1102be055 (patch) | |
tree | e26a6552fed351e89d28d9fdd5cc6625a93df434 | |
parent | 9a9ba4c4d84ec149596f21472cdf632ced8bcd8e (diff) | |
download | postgresql-c5262cfd59cb0b1f1d2adb2131b9c1c1102be055.tar.gz postgresql-c5262cfd59cb0b1f1d2adb2131b9c1c1102be055.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.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h index e76b4b9bb95..7b945bb18a0 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 */ |