mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
WorkQueueThread: rework Cancel/Shutdown workflow
- Cancel doesn't shut down anymore. Allowing it to be used multiple times thoughout the life of the WorkQueue - Remove Clear, so we only have Cancel semantics - Add IsCancelling so work items can abort early if cancelling - Replace m_cancelled and m_thread.joinable() guars with m_shutdown. - Rename Flush to WaitForCompletion (As it's ambiguous if a function called flush should be blocking or not) - Add documentation
This commit is contained in:
@ -37,7 +37,7 @@ GameTracker::GameTracker(QObject* parent) : QFileSystemWatcher(parent)
|
||||
|
||||
connect(qApp, &QApplication::aboutToQuit, this, [this] {
|
||||
m_processing_halted = true;
|
||||
m_load_thread.Cancel();
|
||||
m_load_thread.Shutdown(true);
|
||||
});
|
||||
connect(this, &QFileSystemWatcher::directoryChanged, this, &GameTracker::UpdateDirectory);
|
||||
connect(this, &QFileSystemWatcher::fileChanged, this, &GameTracker::UpdateFile);
|
||||
@ -203,7 +203,7 @@ void GameTracker::RemoveDirectory(const QString& dir)
|
||||
void GameTracker::RefreshAll()
|
||||
{
|
||||
m_processing_halted = true;
|
||||
m_load_thread.Clear();
|
||||
m_load_thread.Cancel();
|
||||
m_load_thread.EmplaceItem(Command{CommandType::ResumeProcessing, {}});
|
||||
|
||||
if (m_needs_purge)
|
||||
|
Reference in New Issue
Block a user