diff --git a/mingw.mutex.h b/mingw.mutex.h index cca9391..1104a94 100644 --- a/mingw.mutex.h +++ b/mingw.mutex.h @@ -278,7 +278,10 @@ class mutex break; } if (state == 1) + { this_thread::yield(); + state = mState.load(std::memory_order_acquire); + } } #ifndef STDMUTEX_NO_RECURSION_CHECKS DWORD self = mOwnerThread.checkOwnerBeforeLock();