Author: cwittich
Date: Wed Jul  4 21:05:31 2007
New Revision: 27391
URL: 
http://svn.reactos.org/svn/reactos?rev=27391&view=rev
Log:
fixed IopLockFileObject
Modified:
    trunk/reactos/ntoskrnl/include/internal/io_x.h
Modified: trunk/reactos/ntoskrnl/include/internal/io_x.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/io_x.h (original)
+++ trunk/reactos/ntoskrnl/include/internal/io_x.h Wed Jul  4 21:05:31 2007
@@ -10,12 +10,13 @@
 static __inline
 IopLockFileObject(IN PFILE_OBJECT FileObject)
 {
-    /* Lock the FO and check for contention */
-    if (InterlockedExchange((PLONG)&FileObject->Busy, TRUE))
+       /* Lock the FO and check for contention */
+    InterlockedIncrement((PLONG)&FileObject->Waiters);
+    while (InterlockedCompareExchange((PLONG)&FileObject->Busy, TRUE, FALSE) !=
FALSE)
     {
-        /* FIXME: Implement contention case */
-        KEBUGCHECK(0);
+        /* FIXME - pause for a little while? */
     }
+    InterlockedDecrement((PLONG)&FileObject->Waiters);
 }
 VOID