Skip to content

Commit

Permalink
Merge branch 'main' into FixClang19Build
Browse files Browse the repository at this point in the history
  • Loading branch information
marcalff authored Nov 7, 2024
2 parents 46f494e + ff2447d commit e6ee262
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions api/include/opentelemetry/common/spin_lock_mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ class SpinLockMutex
# else
__builtin_ia32_pause();
# endif
#elif defined(__arm__)
__asm__ volatile("yield" ::: "memory");
#elif defined(__armel__) || defined(__ARMEL__)
asm volatile("nop" ::: "memory");
#elif defined(__arm__) || defined(__aarch64__) // arm big endian / arm64
__asm__ __volatile__("yield" ::: "memory");
#else
// TODO: Issue PAGE/YIELD on other architectures.
#endif
Expand Down
6 changes: 4 additions & 2 deletions api/test/common/spinlock_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,10 @@ static void BM_ProcYieldSpinLockThrashing(benchmark::State &s)
# else
__builtin_ia32_pause();
# endif
#elif defined(__arm__)
__asm__ volatile("yield" ::: "memory");
#elif defined(__armel__) || defined(__ARMEL__)
asm volatile("nop" ::: "memory");
#elif defined(__arm__) || defined(__aarch64__) // arm big endian / arm64
__asm__ __volatile__("yield" ::: "memory");
#endif
}
},
Expand Down

0 comments on commit e6ee262

Please sign in to comment.