From ee1db0630ada3b4f5bb3e8f87b53458088e87a03 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 23 Oct 2022 14:21:39 +0200 Subject: [PATCH] pipeline: _mm_pause alternative on non-x86 Windows --- dtool/src/dtoolbase/mutexSpinlockImpl.cxx | 2 ++ panda/src/pipeline/conditionVarSpinlockImpl.cxx | 2 ++ panda/src/pipeline/reMutexSpinlockImpl.cxx | 2 ++ 3 files changed, 6 insertions(+) diff --git a/dtool/src/dtoolbase/mutexSpinlockImpl.cxx b/dtool/src/dtoolbase/mutexSpinlockImpl.cxx index 73f2683ff2..788152422c 100644 --- a/dtool/src/dtoolbase/mutexSpinlockImpl.cxx +++ b/dtool/src/dtoolbase/mutexSpinlockImpl.cxx @@ -20,6 +20,8 @@ #if defined(__i386__) || defined(__x86_64) || defined(_M_IX86) || defined(_M_X64) #include #define PAUSE() _mm_pause() +#elif defined(_WIN32) +#define PAUSE() YieldProcessor() #else #define PAUSE() #endif diff --git a/panda/src/pipeline/conditionVarSpinlockImpl.cxx b/panda/src/pipeline/conditionVarSpinlockImpl.cxx index 2b4be0d4e7..c5dc58ff96 100644 --- a/panda/src/pipeline/conditionVarSpinlockImpl.cxx +++ b/panda/src/pipeline/conditionVarSpinlockImpl.cxx @@ -21,6 +21,8 @@ #if defined(__i386__) || defined(__x86_64) || defined(_M_IX86) || defined(_M_X64) #include #define PAUSE() _mm_pause() +#elif defined(_WIN32) +#define PAUSE() YieldProcessor() #else #define PAUSE() #endif diff --git a/panda/src/pipeline/reMutexSpinlockImpl.cxx b/panda/src/pipeline/reMutexSpinlockImpl.cxx index de0b2c0355..4ad9b12410 100644 --- a/panda/src/pipeline/reMutexSpinlockImpl.cxx +++ b/panda/src/pipeline/reMutexSpinlockImpl.cxx @@ -21,6 +21,8 @@ #if defined(__i386__) || defined(__x86_64) || defined(_M_IX86) || defined(_M_X64) #include #define PAUSE() _mm_pause() +#elif defined(_WIN32) +#define PAUSE() YieldProcessor() #else #define PAUSE() #endif