msvcp120: Add _Mtx_current_owns.

Signed-off-by: Daniel Lehman <dlehman@esri.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Daniel Lehman 2016-03-28 13:12:02 -07:00 committed by Alexandre Julliard
parent 31bc775c65
commit 2a65d21d1a
4 changed files with 8 additions and 3 deletions

View File

@ -3818,7 +3818,7 @@
@ stub _Lock_shared_ptr_spin_lock
@ cdecl _Mbrtowc(ptr ptr long ptr ptr)
@ stub _Mtx_clear_owner
@ stub _Mtx_current_owns
@ cdecl _Mtx_current_owns(ptr)
@ cdecl _Mtx_destroy(ptr)
@ cdecl _Mtx_getconcrtcs(ptr)
@ cdecl _Mtx_init(ptr long)

View File

@ -3763,7 +3763,7 @@
@ stub _Lock_shared_ptr_spin_lock
@ cdecl _Mbrtowc(ptr ptr long ptr ptr)
@ stub _Mtx_clear_owner
@ stub _Mtx_current_owns
@ cdecl _Mtx_current_owns(ptr)
@ cdecl _Mtx_destroy(ptr)
@ cdecl _Mtx_getconcrtcs(ptr)
@ cdecl _Mtx_init(ptr long)

View File

@ -3763,7 +3763,7 @@
@ stub _Lock_shared_ptr_spin_lock
@ cdecl _Mbrtowc(ptr ptr long ptr ptr) msvcp120._Mbrtowc
@ stub _Mtx_clear_owner
@ stub _Mtx_current_owns
@ cdecl _Mtx_current_owns(ptr) msvcp120._Mtx_current_owns
@ cdecl _Mtx_destroy(ptr) msvcp120._Mtx_destroy
@ cdecl _Mtx_getconcrtcs(ptr) msvcp120._Mtx_getconcrtcs
@ cdecl _Mtx_init(ptr long) msvcp120._Mtx_init

View File

@ -487,6 +487,11 @@ void __cdecl _Mtx_destroy(_Mtx_t *mtx)
MSVCRT_operator_delete(*mtx);
}
int __cdecl _Mtx_current_owns(_Mtx_t *mtx)
{
return (*mtx)->thread_id == GetCurrentThreadId();
}
int __cdecl _Mtx_lock(_Mtx_t *mtx)
{
if((*mtx)->thread_id != GetCurrentThreadId()) {