Module: wine Branch: master Commit: a6bfecd4019ec9869d51d296c48e9250ebbed3e6 URL: http://source.winehq.org/git/wine.git/?a=commit;h=a6bfecd4019ec9869d51d296c4...
Author: Piotr Caban piotr@codeweavers.com Date: Tue Feb 28 11:21:34 2017 +0100
msvcr100: Use InterlockedDecrement in SpinWait::_SpinOnce.
Signed-off-by: Piotr Caban piotr@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/msvcrt/lock.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/dlls/msvcrt/lock.c b/dlls/msvcrt/lock.c index 3153ae1..f4c44170 100644 --- a/dlls/msvcrt/lock.c +++ b/dlls/msvcrt/lock.c @@ -265,13 +265,7 @@ MSVCRT_bool __thiscall SpinWait__SpinOnce(SpinWait *this) SpinWait__Reset(this); /* fall through */ case SPINWAIT_SPIN: -#ifdef __i386__ - __asm__ __volatile__( "rep;nop" : : : "memory" ); -#else - __asm__ __volatile__( "" : : : "memory" ); -#endif - - this->spin--; + InterlockedDecrement((LONG*)&this->spin); if(!this->spin) this->state = this->unknown ? SPINWAIT_YIELD : SPINWAIT_DONE; return TRUE;