Merge pull request #384 from 'henriquegemignani-feature/lockless-dvdfile-destructor'

This commit is contained in:
Phillip Stephens 2021-04-03 10:24:31 -07:00
commit 5bb3dc86dd
1 changed files with 3 additions and 0 deletions

View File

@ -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);
} }