--- trunk/reactos/lib/ntdll/rtl/critical.c 2005-08-25 12:30:10 UTC (rev 17537)
+++ trunk/reactos/lib/ntdll/rtl/critical.c 2005-08-25 12:33:37 UTC (rev 17538)
@@ -329,10 +329,11 @@
CriticalSection->OwningThread = 0;
/* Was someone wanting us? This needs to be done atomically. */
- InterlockedDecrement(&CriticalSection->LockCount);
+ if (-1 != InterlockedDecrement(&CriticalSection->LockCount)) {
- /* Let him have us */
- RtlpUnWaitCriticalSection(CriticalSection);
+ /* Let him have us */
+ RtlpUnWaitCriticalSection(CriticalSection);
+ }
}
/* Sucessful! */