summaryrefslogtreecommitdiffstats
path: root/src/yuzu/game_list_worker.cpp
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2023-10-13 15:29:13 +0200
committerGitHub <noreply@github.com>2023-10-13 15:29:13 +0200
commit1a4874e178860d723760d98be337cd4640b06a30 (patch)
treeafe20068da407a90e3ec5b38e3d8ae02a5afb2cd /src/yuzu/game_list_worker.cpp
parentMerge pull request #11766 from liamwhite/open-sesame (diff)
parentqt: ensure worker cancellation is complete before clearing (diff)
downloadyuzu-1a4874e178860d723760d98be337cd4640b06a30.tar
yuzu-1a4874e178860d723760d98be337cd4640b06a30.tar.gz
yuzu-1a4874e178860d723760d98be337cd4640b06a30.tar.bz2
yuzu-1a4874e178860d723760d98be337cd4640b06a30.tar.lz
yuzu-1a4874e178860d723760d98be337cd4640b06a30.tar.xz
yuzu-1a4874e178860d723760d98be337cd4640b06a30.tar.zst
yuzu-1a4874e178860d723760d98be337cd4640b06a30.zip
Diffstat (limited to 'src/yuzu/game_list_worker.cpp')
-rw-r--r--src/yuzu/game_list_worker.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/yuzu/game_list_worker.cpp b/src/yuzu/game_list_worker.cpp
index 588f1dd6e..077ced12b 100644
--- a/src/yuzu/game_list_worker.cpp
+++ b/src/yuzu/game_list_worker.cpp
@@ -293,7 +293,7 @@ void GameListWorker::AddTitlesToGameList(GameListDir* parent_dir) {
void GameListWorker::ScanFileSystem(ScanTarget target, const std::string& dir_path, bool deep_scan,
GameListDir* parent_dir) {
const auto callback = [this, target, parent_dir](const std::filesystem::path& path) -> bool {
- if (stop_processing) {
+ if (stop_requested) {
// Breaks the callback loop.
return false;
}
@@ -399,7 +399,6 @@ void GameListWorker::ScanFileSystem(ScanTarget target, const std::string& dir_pa
}
void GameListWorker::run() {
- stop_processing = false;
provider->ClearAllEntries();
for (UISettings::GameDir& game_dir : game_dirs) {
@@ -427,9 +426,11 @@ void GameListWorker::run() {
}
emit Finished(watch_list);
+ processing_completed.Set();
}
void GameListWorker::Cancel() {
this->disconnect();
- stop_processing = true;
+ stop_requested.store(true);
+ processing_completed.Wait();
}