fixed IopLockFileObject

svn path=/trunk/; revision=27391
This commit is contained in:
Christoph von Wittich 2007-07-04 17:05:31 +00:00
parent be2228c407
commit 6fccf28376

View file

@ -10,12 +10,13 @@ VOID
static __inline static __inline
IopLockFileObject(IN PFILE_OBJECT FileObject) IopLockFileObject(IN PFILE_OBJECT FileObject)
{ {
/* Lock the FO and check for contention */ /* Lock the FO and check for contention */
if (InterlockedExchange((PLONG)&FileObject->Busy, TRUE)) InterlockedIncrement((PLONG)&FileObject->Waiters);
while (InterlockedCompareExchange((PLONG)&FileObject->Busy, TRUE, FALSE) != FALSE)
{ {
/* FIXME: Implement contention case */ /* FIXME - pause for a little while? */
KEBUGCHECK(0);
} }
InterlockedDecrement((PLONG)&FileObject->Waiters);
} }
VOID VOID