Fixed a bug in RtlLeaveCriticalSection. We have only to signal the event if someone waits on it.

svn path=/trunk/; revision=17538
This commit is contained in:
Hartmut Birr 2005-08-25 12:33:37 +00:00
parent 8370e44f84
commit 25d3bf68ab

View file

@ -329,10 +329,11 @@ RtlLeaveCriticalSection(
CriticalSection->OwningThread = 0; CriticalSection->OwningThread = 0;
/* Was someone wanting us? This needs to be done atomically. */ /* Was someone wanting us? This needs to be done atomically. */
InterlockedDecrement(&CriticalSection->LockCount); if (-1 != InterlockedDecrement(&CriticalSection->LockCount)) {
/* Let him have us */ /* Let him have us */
RtlpUnWaitCriticalSection(CriticalSection); RtlpUnWaitCriticalSection(CriticalSection);
}
} }
/* Sucessful! */ /* Sucessful! */