mirror of
https://github.com/reactos/reactos.git
synced 2024-12-30 19:14:31 +00:00
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:
parent
8370e44f84
commit
25d3bf68ab
1 changed files with 4 additions and 3 deletions
|
@ -329,11 +329,12 @@ 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! */
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
|
Loading…
Reference in a new issue