mirror of https://github.com/AxioDL/metaforce.git
Improve CFileDvdRequest::PostCancelRequest
Do nothing if either m_complete or m_cancel is set, avoiding waiting for the mutex for no reason.
This commit is contained in:
parent
b5378e9361
commit
eed6022a15
|
@ -28,6 +28,9 @@ public:
|
||||||
}
|
}
|
||||||
bool IsComplete() override { return m_complete.load(); }
|
bool IsComplete() override { return m_complete.load(); }
|
||||||
void PostCancelRequest() override {
|
void PostCancelRequest() override {
|
||||||
|
if (m_complete.load() || m_cancel.load()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
std::unique_lock waitlk{CDvdFile::m_WaitMutex};
|
std::unique_lock waitlk{CDvdFile::m_WaitMutex};
|
||||||
m_cancel.store(true);
|
m_cancel.store(true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue