mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 12:43:09 +00:00
use _mm_pause (#1433)
This commit is contained in:
@@ -53,7 +53,8 @@ spinlock_destroy(struct spinlock *lock) {
|
|||||||
#define atomic_load_relaxed_(ptr) atomic_load_explicit(ptr, memory_order_relaxed)
|
#define atomic_load_relaxed_(ptr) atomic_load_explicit(ptr, memory_order_relaxed)
|
||||||
|
|
||||||
#if defined(__x86_64__)
|
#if defined(__x86_64__)
|
||||||
#define atomic_pause_() __builtin_ia32_pause()
|
#include <immintrin.h> // For _mm_pause
|
||||||
|
#define atomic_pause_() _mm_pause()
|
||||||
#else
|
#else
|
||||||
#define atomic_pause_() ((void)0)
|
#define atomic_pause_() ((void)0)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user