Author: tfaber
Date: Mon Jan 23 19:48:18 2012
New Revision: 55128
URL:
http://svn.reactos.org/svn/reactos?rev=55128&view=rev
Log:
[NTOSKRNL/IO]
- Always use interlocked operations on DeviceObject->ReferenceCount
Modified:
trunk/reactos/ntoskrnl/io/iomgr/device.c
trunk/reactos/ntoskrnl/io/iomgr/file.c
Modified: trunk/reactos/ntoskrnl/io/iomgr/device.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/device.c…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/device.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/device.c [iso-8859-1] Mon Jan 23 19:48:18 2012
@@ -486,7 +486,7 @@
ASSERT(DeviceObject->ReferenceCount);
/* Dereference the device */
- DeviceObject->ReferenceCount--;
+ InterlockedDecrement(&DeviceObject->ReferenceCount);
/*
* Check if we can unload it and it's safe to unload (or if we're forcing
Modified: trunk/reactos/ntoskrnl/io/iomgr/file.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/file.c?r…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/file.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/file.c [iso-8859-1] Mon Jan 23 19:48:18 2012
@@ -157,7 +157,7 @@
else
{
/* Increase reference count */
- DeviceObject->ReferenceCount++;
+ InterlockedIncrement(&DeviceObject->ReferenceCount);
return STATUS_SUCCESS;
}
}