From a689855546697c4fa0b873986931e35835c2b2d6 Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Tue, 12 Apr 2022 12:19:46 -0700 Subject: [PATCH 1/2] fix yield on ARM --- api/include/opentelemetry/common/spin_lock_mutex.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/api/include/opentelemetry/common/spin_lock_mutex.h b/api/include/opentelemetry/common/spin_lock_mutex.h index b35f54081a..d38d5791d5 100644 --- a/api/include/opentelemetry/common/spin_lock_mutex.h +++ b/api/include/opentelemetry/common/spin_lock_mutex.h @@ -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 From 5afaf3a902f07303c9e1cf76d73f434cbdf48c0e Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Tue, 12 Apr 2022 12:23:36 -0700 Subject: [PATCH 2/2] fix benchmark test --- api/test/common/spinlock_benchmark.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/test/common/spinlock_benchmark.cc b/api/test/common/spinlock_benchmark.cc index 28692bee56..07579579c7 100644 --- a/api/test/common/spinlock_benchmark.cc +++ b/api/test/common/spinlock_benchmark.cc @@ -93,7 +93,7 @@ static void BM_ProcYieldSpinLockThrashing(benchmark::State &s) __builtin_ia32_pause(); # endif #elif defined(__arm__) - __yield(); + __asm__ volatile("yield" ::: "memory"); #endif } },