diff options
author | Tor Egge <Tor.Egge@online.no> | 2022-04-05 22:02:48 +0200 |
---|---|---|
committer | Tor Egge <Tor.Egge@online.no> | 2022-04-05 22:02:48 +0200 |
commit | ad6a1fa567ad0b7f346d15e0c08b94a2ffd35c34 (patch) | |
tree | bac473af14b316739ba22ef58f666c9e52323739 /vespalib/src/tests | |
parent | d5178634c6f15f163b37888109b3a6a3374b596b (diff) |
Add missing include statements. Check for atomic wait support.
Diffstat (limited to 'vespalib/src/tests')
-rw-r--r-- | vespalib/src/tests/wakeup/wakeup_bench.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/vespalib/src/tests/wakeup/wakeup_bench.cpp b/vespalib/src/tests/wakeup/wakeup_bench.cpp index c39b8899159..dc6ca70a4d1 100644 --- a/vespalib/src/tests/wakeup/wakeup_bench.cpp +++ b/vespalib/src/tests/wakeup/wakeup_bench.cpp @@ -137,6 +137,7 @@ struct UsePipe : State { } }; +#if __cpp_lib_atomic_wait struct UseAtomic : State { void wakeup() { set_wakeup(); @@ -151,6 +152,7 @@ struct UseAtomic : State { // assert(!is_ready()); } }; +#endif #ifdef __linux__ struct UseFutex : State { @@ -284,7 +286,9 @@ TEST(WakeupBench, using_spin_yield) { benchmark<Wakeup<UseSpinYield>>(); } TEST(WakeupBench, using_cond) { benchmark<Wakeup<UseCond>>(); } TEST(WakeupBench, using_cond_nolock) { benchmark<Wakeup<UseCondNolock>>(); } TEST(WakeupBench, using_pipe) { benchmark<Wakeup<UsePipe>>(); } +#if __cpp_lib_atomic_wait TEST(WakeupBench, using_atomic) { benchmark<Wakeup<UseAtomic>>(); } +#endif #ifdef __linux__ TEST(WakeupBench, using_futex) { benchmark<Wakeup<UseFutex>>(); } |