Skip to content

Commit

Permalink
Merge pull request #6 from nmcclatchey/improve-vista-performance
Browse files Browse the repository at this point in the history
Fix infinite loop for mutexes in Windows XP and Vista.
  • Loading branch information
nmcclatchey authored Apr 29, 2018
2 parents 07125e6 + 902f06e commit 3b716a7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mingw.mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 3b716a7

Please sign in to comment.