From 6fccf283764941acdefa5dc9b884cd02ba1bde81 Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Wed, 4 Jul 2007 17:05:31 +0000 Subject: [PATCH] fixed IopLockFileObject svn path=/trunk/; revision=27391 --- reactos/ntoskrnl/include/internal/io_x.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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