diff --git a/reactos/ntoskrnl/include/internal/io_x.h b/reactos/ntoskrnl/include/internal/io_x.h index 9d9464421a0..a176ba3622a 100644 --- a/reactos/ntoskrnl/include/internal/io_x.h +++ b/reactos/ntoskrnl/include/internal/io_x.h @@ -10,12 +10,13 @@ VOID 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