msvcp140: Add _Mtx_init/destroy_in_situ.

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-05-26 20:52:21 -07:00 committed by Alexandre Julliard
parent 236b5f5887
commit 4b41672f9f
2 changed files with 17 additions and 7 deletions

View File

@ -3675,10 +3675,10 @@
@ stub _Mtx_clear_owner
@ cdecl _Mtx_current_owns(ptr) msvcp110._Mtx_current_owns
@ cdecl _Mtx_destroy(ptr) _Mtx_destroy
@ stub _Mtx_destroy_in_situ
@ cdecl _Mtx_destroy_in_situ(ptr) _Mtx_destroy_in_situ
@ cdecl _Mtx_getconcrtcs(ptr) _Mtx_getconcrtcs
@ cdecl _Mtx_init(ptr long) _Mtx_init
@ stub _Mtx_init_in_situ
@ cdecl _Mtx_init_in_situ(ptr long) _Mtx_init_in_situ
@ cdecl _Mtx_lock(ptr) _Mtx_lock
@ stub _Mtx_reset_owner
@ stub _Mtx_timedlock

View File

@ -478,19 +478,29 @@ typedef _Mtx_t *_Mtx_arg_t;
#define MTX_T_TO_ARG(m) (&(m))
#endif
int __cdecl _Mtx_init(_Mtx_t *mtx, int flags)
void __cdecl _Mtx_init_in_situ(_Mtx_t mtx, int flags)
{
if(flags & ~MTX_MULTI_LOCK)
FIXME("unknown flags ignored: %x\n", flags);
mtx->flags = flags;
call_func1(critical_section_ctor, &mtx->cs);
mtx->thread_id = -1;
mtx->count = 0;
}
int __cdecl _Mtx_init(_Mtx_t *mtx, int flags)
{
*mtx = MSVCRT_operator_new(sizeof(**mtx));
(*mtx)->flags = flags;
call_func1(critical_section_ctor, &(*mtx)->cs);
(*mtx)->thread_id = -1;
(*mtx)->count = 0;
_Mtx_init_in_situ(*mtx, flags);
return 0;
}
void __cdecl _Mtx_destroy_in_situ(_Mtx_t mtx)
{
call_func1(critical_section_dtor, &mtx->cs);
}
void __cdecl _Mtx_destroy(_Mtx_arg_t mtx)
{
call_func1(critical_section_dtor, &MTX_T_FROM_ARG(mtx)->cs);