msvcp140: Add _Cnd_init_in_situ implementation.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2016-09-23 16:28:21 +02:00 committed by Alexandre Julliard
parent f41466261d
commit 61e6e8baa0
2 changed files with 8 additions and 4 deletions

View File

@ -3626,7 +3626,7 @@
@ stub _Cnd_destroy_in_situ
@ stub _Cnd_do_broadcast_at_thread_exit
@ cdecl _Cnd_init(ptr) _Cnd_init
@ stub _Cnd_init_in_situ
@ cdecl _Cnd_init_in_situ(ptr)
@ stub _Cnd_register_at_thread_exit
@ cdecl _Cnd_signal(ptr) _Cnd_signal
@ cdecl _Cnd_timedwait(ptr ptr ptr) _Cnd_timedwait

View File

@ -584,10 +584,9 @@ typedef _Cnd_t *_Cnd_arg_t;
static HANDLE keyed_event;
int __cdecl _Cnd_init(_Cnd_t *cnd)
void __cdecl _Cnd_init_in_situ(_Cnd_t cnd)
{
*cnd = MSVCRT_operator_new(sizeof(**cnd));
InitializeConditionVariable(&(*cnd)->cv);
InitializeConditionVariable(&cnd->cv);
if(!keyed_event) {
HANDLE event;
@ -596,7 +595,12 @@ int __cdecl _Cnd_init(_Cnd_t *cnd)
if(InterlockedCompareExchangePointer(&keyed_event, event, NULL) != NULL)
NtClose(event);
}
}
int __cdecl _Cnd_init(_Cnd_t *cnd)
{
*cnd = MSVCRT_operator_new(sizeof(**cnd));
_Cnd_init_in_situ(*cnd);
return 0;
}