ntdll: Avoid importing RtlEnterCriticalSection/RtlLeaveCriticalSection from the Unix side.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
081d25d4b9
commit
1d3e3a1c8d
|
@ -2522,9 +2522,20 @@ NTSTATUS CDECL fast_RtlSleepConditionVariableCS( RTL_CONDITION_VARIABLE *variabl
|
|||
|
||||
val = *futex;
|
||||
|
||||
RtlLeaveCriticalSection( cs );
|
||||
status = wait_cv( futex, val, timeout );
|
||||
RtlEnterCriticalSection( cs );
|
||||
if (cs->RecursionCount == 1)
|
||||
{
|
||||
/* FIXME: simplified version of RtlLeaveCriticalSection/RtlEnterCriticalSection to avoid imports */
|
||||
cs->RecursionCount = 0;
|
||||
cs->OwningThread = 0;
|
||||
if (InterlockedDecrement( &cs->LockCount ) >= 0) fast_RtlpUnWaitCriticalSection( cs );
|
||||
|
||||
status = wait_cv( futex, val, timeout );
|
||||
|
||||
if (InterlockedIncrement( &cs->LockCount )) fast_RtlpWaitForCriticalSection( cs, INT_MAX );
|
||||
cs->OwningThread = ULongToHandle( GetCurrentThreadId() );
|
||||
cs->RecursionCount = 1;
|
||||
}
|
||||
else status = wait_cv( futex, val, timeout );
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue