Skip to content

Commit

Permalink
Adding the assembly yeild command to support noop for ARM
Browse files Browse the repository at this point in the history
Signed-off-by: Toby Flynn <[email protected]>
  • Loading branch information
flynn378 authored and RalphSteinhagen committed Sep 26, 2024
1 parent a54c106 commit 1e41e38
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions core/include/gnuradio-4.0/WaitStrategy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,12 @@ class SpinWait {
yieldProcessor();
}
}
#if not defined(__EMSCRIPTEN__) && not defined(__APPLE__)
static void yieldProcessor() noexcept { asm volatile("rep\nnop"); }
#else
#if defined( __EMSCRIPTEN__)
static void yieldProcessor() noexcept { std::this_thread::sleep_for(std::chrono::milliseconds(1)); }
#elif defined(DISRUPTOR_CPU_ARM)
static void yieldProcessor() noexcept { asm volatile("yield"); }
#else
static void yieldProcessor() noexcept { asm volatile("rep\nnop"); }
#endif

public:
Expand Down

0 comments on commit 1e41e38

Please sign in to comment.