msvcp110: Add _Lock_shared_ptr_spin_lock implementation.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2017-02-28 11:21:00 +01:00 committed by Alexandre Julliard
parent a33f4646cd
commit 3b9e9dd06a
5 changed files with 29 additions and 8 deletions

View File

@ -3815,7 +3815,7 @@
@ stub _LXp_sqrtx
@ stub _LXp_subx
@ extern _LZero
@ stub _Lock_shared_ptr_spin_lock
@ cdecl _Lock_shared_ptr_spin_lock()
@ cdecl _Mbrtowc(ptr ptr long ptr ptr)
@ stub _Mtx_clear_owner
@ cdecl _Mtx_current_owns(ptr)
@ -3874,7 +3874,7 @@
@ stub _Tss_delete
@ stub _Tss_get
@ stub _Tss_set
@ stub _Unlock_shared_ptr_spin_lock
@ cdecl _Unlock_shared_ptr_spin_lock()
@ cdecl _Wcrtomb(ptr long ptr ptr)
@ cdecl _Wcscoll(ptr ptr ptr ptr ptr)
@ stub _Wcsxfrm

View File

@ -3760,7 +3760,7 @@
@ stub _LXp_sqrtx
@ stub _LXp_subx
@ extern _LZero
@ stub _Lock_shared_ptr_spin_lock
@ cdecl _Lock_shared_ptr_spin_lock()
@ cdecl _Mbrtowc(ptr ptr long ptr ptr)
@ stub _Mtx_clear_owner
@ cdecl _Mtx_current_owns(ptr)
@ -3821,7 +3821,7 @@
@ stub _Tss_delete
@ stub _Tss_get
@ stub _Tss_set
@ stub _Unlock_shared_ptr_spin_lock
@ cdecl _Unlock_shared_ptr_spin_lock()
@ cdecl _Wcrtomb(ptr long ptr ptr)
@ cdecl _Wcscoll(ptr ptr ptr ptr ptr)
@ stub _Wcsxfrm

View File

@ -3760,7 +3760,7 @@
@ stub _LXp_sqrtx
@ stub _LXp_subx
@ extern _LZero msvcp120._LZero
@ stub _Lock_shared_ptr_spin_lock
@ cdecl _Lock_shared_ptr_spin_lock() msvcp120._Lock_shared_ptr_spin_lock
@ cdecl _Mbrtowc(ptr ptr long ptr ptr) msvcp120._Mbrtowc
@ stub _Mtx_clear_owner
@ cdecl _Mtx_current_owns(ptr) msvcp120._Mtx_current_owns
@ -3821,7 +3821,7 @@
@ stub _Tss_delete
@ stub _Tss_get
@ stub _Tss_set
@ stub _Unlock_shared_ptr_spin_lock
@ cdecl _Unlock_shared_ptr_spin_lock() msvcp120._Unlock_shared_ptr_spin_lock
@ cdecl _Wcrtomb(ptr long ptr ptr) msvcp120._Wcrtomb
@ cdecl _Wcscoll(ptr ptr ptr ptr ptr) msvcp120._Wcscoll
@ stub _Wcsxfrm

View File

@ -3668,7 +3668,7 @@
@ extern _LSnan _LSnan
@ stub _Last_write_time
@ stub _Link
@ stub _Lock_shared_ptr_spin_lock
@ cdecl _Lock_shared_ptr_spin_lock()
@ stub _Lstat
@ stub _Make_dir
@ cdecl _Mbrtowc(ptr ptr long ptr ptr) _Mbrtowc
@ -3738,7 +3738,7 @@
@ cdecl _Towlower(long ptr) _Towlower
@ cdecl _Towupper(long ptr) _Towupper
@ stub _Unlink
@ stub _Unlock_shared_ptr_spin_lock
@ cdecl _Unlock_shared_ptr_spin_lock()
@ stub _WStod
@ stub _WStodx
@ stub _WStof

View File

@ -1339,3 +1339,24 @@ void __cdecl threads__Mtx_unlock(void *mtx)
{
LeaveCriticalSection(mtx);
}
#if _MSVCP_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