Skip to content

Commit

Permalink
Update yield logic for ARM processor (#1325)
Browse files Browse the repository at this point in the history
  • Loading branch information
lalitb authored Apr 12, 2022
1 parent da2911c commit 75c2a8f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions api/include/opentelemetry/common/spin_lock_mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,7 @@ class SpinLockMutex
__builtin_ia32_pause();
# endif
#elif defined(__arm__)
// This intrinsic should fail to be found if YIELD is not supported on the current
// processor.
__yield();
__asm__ volatile("yield" ::: "memory");
#else
// TODO: Issue PAGE/YIELD on other architectures.
#endif
Expand Down
2 changes: 1 addition & 1 deletion api/test/common/spinlock_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static void BM_ProcYieldSpinLockThrashing(benchmark::State &s)
__builtin_ia32_pause();
# endif
#elif defined(__arm__)
__yield();
__asm__ volatile("yield" ::: "memory");
#endif
}
},
Expand Down

0 comments on commit 75c2a8f

Please sign in to comment.