Commit 26d30c63 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcr110: Add _Lock_shared_ptr_spin_lock implementation.

parent 3b9e9dd0
...@@ -854,7 +854,7 @@ ...@@ -854,7 +854,7 @@
@ cdecl _Gettnames() @ cdecl _Gettnames()
@ extern _HUGE MSVCRT__HUGE @ extern _HUGE MSVCRT__HUGE
@ cdecl _IsExceptionObjectToBeDestroyed(ptr) @ cdecl _IsExceptionObjectToBeDestroyed(ptr)
@ stub _Lock_shared_ptr_spin_lock @ cdecl _Lock_shared_ptr_spin_lock()
@ stub -arch=i386 _NLG_Dispatch2 @ stub -arch=i386 _NLG_Dispatch2
@ stub -arch=arm,win64 __NLG_Dispatch2 @ stub -arch=arm,win64 __NLG_Dispatch2
@ stub -arch=i386 _NLG_Return @ stub -arch=i386 _NLG_Return
...@@ -863,7 +863,7 @@ ...@@ -863,7 +863,7 @@
@ stub -arch=win64 _SetImageBase @ stub -arch=win64 _SetImageBase
@ stub -arch=win64 _SetThrowImageBase @ stub -arch=win64 _SetThrowImageBase
@ cdecl _Strftime(str long str ptr ptr) @ cdecl _Strftime(str long str ptr ptr)
@ stub _Unlock_shared_ptr_spin_lock @ cdecl _Unlock_shared_ptr_spin_lock()
@ cdecl _W_Getdays() @ cdecl _W_Getdays()
@ cdecl _W_Getmonths() @ cdecl _W_Getmonths()
@ cdecl _W_Gettnames() @ cdecl _W_Gettnames()
......
...@@ -1018,6 +1018,27 @@ MSVCRT_bool __thiscall _ReentrantBlockingLock__TryAcquire(_ReentrantBlockingLock ...@@ -1018,6 +1018,27 @@ MSVCRT_bool __thiscall _ReentrantBlockingLock__TryAcquire(_ReentrantBlockingLock
} }
#endif #endif
#if _MSVCR_VER == 110
static LONG shared_ptr_lock;
void __cdecl _Lock_shared_ptr_spin_lock(void)
{
LONG l = 0;
while(InterlockedCompareExchange(&shared_ptr_lock, 1, 0) != 0) {
if(l++ == 1000) {
Sleep(0);
l = 0;
}
}
}
void __cdecl _Unlock_shared_ptr_spin_lock(void)
{
shared_ptr_lock = 0;
}
#endif
/********************************************************************** /**********************************************************************
* msvcrt_free_locks (internal) * msvcrt_free_locks (internal)
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment