17 #ifndef AGX_SPINMUTEX_H 18 #define AGX_SPINMUTEX_H 20 #include <agx/config/AGX_USE_SSE.h> 21 #include <agx/config/AGX_DEBUG_SYNCHRONIZATION_OVERHEAD_TESTING.h> 29 #include <xmmintrin.h> 30 #include <emmintrin.h> 35 # pragma warning(push) 36 # pragma warning( disable : 4275 ) // warning C4275: non dll-interface class 37 # pragma warning(disable: 4251) // warning C4251: class X needs to have dll-interface to be used by clients of class Y 82 bool isLocked()
const;
85 std::atomic<int> m_lock;
105 #if AGX_DEBUG_SYNCHRONIZATION_OVERHEAD_TESTING() 109 agx::Int32 prev = m_lock.exchange(1, std::memory_order_acquire);
116 prev = m_lock.exchange(1, std::memory_order_acquire);
122 #if AGX_DEBUG_SYNCHRONIZATION_OVERHEAD_TESTING() 126 m_lock.store(0, std::memory_order_release);
131 #if AGX_DEBUG_SYNCHRONIZATION_OVERHEAD_TESTING() 135 int32_t prev = m_lock.exchange(1, std::memory_order_acquire);
141 #if AGX_DEBUG_SYNCHRONIZATION_OVERHEAD_TESTING() 145 int32_t prev = m_lock.exchange(1, std::memory_order_acquire);
151 return m_lock.load( std::memory_order_relaxed ) != 0;
156 # pragma warning(pop)
bool isLocked() const
Debug.
bool trylock()
Deprecated.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
void lock()
Lock the mutex.
void unlock()
Unlock the mutex.
AGXCORE_EXPORT bool forcedShutdown()