mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 02:25:17 +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,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! */
|
||||||
|
|
Loading…
Reference in a new issue