diff --git a/src/system/kernel/device_manager/IORequest.cpp b/src/system/kernel/device_manager/IORequest.cpp index 2999ad58f8..a724fc36df 100644 --- a/src/system/kernel/device_manager/IORequest.cpp +++ b/src/system/kernel/device_manager/IORequest.cpp @@ -692,6 +692,7 @@ IOOperation::Dump() const IORequest::IORequest() : + fIsNotified(false), fFinishedCallback(NULL), fFinishedCookie(NULL), fIterationCallback(NULL), @@ -869,7 +870,7 @@ IORequest::Wait(uint32 flags, bigtime_t timeout) { MutexLocker locker(fLock); - if (IsFinished()) + if (IsFinished() && fIsNotified) return Status(); ConditionVariableEntry entry; @@ -932,6 +933,7 @@ IORequest::NotifyFinished() bool deleteRequest = (fFlags & B_DELETE_IO_REQUEST) != 0; // unblock waiters + fIsNotified = true; fFinishedCondition.NotifyAll(); locker.Unlock(); diff --git a/src/system/kernel/device_manager/IORequest.h b/src/system/kernel/device_manager/IORequest.h index bb6f90a42d..8fdbad7eeb 100644 --- a/src/system/kernel/device_manager/IORequest.h +++ b/src/system/kernel/device_manager/IORequest.h @@ -334,6 +334,7 @@ private: bool fIsWrite; bool fPartialTransfer; bool fSuppressChildNotifications; + bool fIsNotified; io_request_finished_callback fFinishedCallback; void* fFinishedCookie;