diff options
author | Tor Egge <Tor.Egge@online.no> | 2021-04-28 19:25:33 +0200 |
---|---|---|
committer | Tor Egge <Tor.Egge@online.no> | 2021-04-28 19:25:33 +0200 |
commit | e80e07867f0b291780cbc30ec673ac3aff277520 (patch) | |
tree | 6ffa885279cf4c69fcfde7f426fbbbc2814688d5 /vespalib | |
parent | 15bce81a42273c35e10f158b74cb3a999189d12e (diff) |
Use std::this_thread::yield()
Diffstat (limited to 'vespalib')
-rw-r--r-- | vespalib/src/vespa/vespalib/util/time.cpp | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/vespalib/src/vespa/vespalib/util/time.cpp b/vespalib/src/vespa/vespalib/util/time.cpp index a732eb215fb..b1e859bde00 100644 --- a/vespalib/src/vespa/vespalib/util/time.cpp +++ b/vespalib/src/vespa/vespalib/util/time.cpp @@ -2,9 +2,6 @@ #include "time.h" #include <thread> -#ifdef __x86_64__ -#include <immintrin.h> -#endif namespace vespalib { @@ -45,13 +42,7 @@ Timer::waitAtLeast(duration dur, bool busyWait) { steady_clock::time_point deadline = steady_clock::now() + dur; while (steady_clock::now() < deadline) { for (int i = 0; i < 1000; i++) { -#if defined(__x86_64__) - _mm_pause(); -#elif defined(__aarch64__) - __asm__ __volatile__ ("yield"); -#else -#warning "Missing yield" -#endif + std::this_thread::yield(); } } } else { |