summaryrefslogtreecommitdiff
path: root/src/yuzu/bootmanager.h
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-06-22 00:04:55 -0300
committerReinUsesLisp <reinuseslisp@airmail.cc>2021-06-22 00:04:57 -0300
commit4009ae1da2360f20721c93cd204eb64c7342eb53 (patch)
tree6bdd3084265212a096832f1e723c0c502f958f32 /src/yuzu/bootmanager.h
parent0485b8e84bacbf7fd56081822faca46114cbeb85 (diff)
bootmanager: Use std::stop_source for stopping emulation
Use its std::stop_token to abort shader cache loading. Using std::stop_token instead of std::atomic_bool allows the usage of other utilities like std::stop_callback.
Diffstat (limited to 'src/yuzu/bootmanager.h')
-rw-r--r--src/yuzu/bootmanager.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/yuzu/bootmanager.h b/src/yuzu/bootmanager.h
index acfe2bc8c..402dd2ee1 100644
--- a/src/yuzu/bootmanager.h
+++ b/src/yuzu/bootmanager.h
@@ -89,16 +89,16 @@ public:
* Requests for the emulation thread to stop running
*/
void RequestStop() {
- stop_run = true;
+ stop_source.request_stop();
SetRunning(false);
}
private:
bool exec_step = false;
bool running = false;
- std::atomic_bool stop_run{false};
+ std::stop_source stop_source;
std::mutex running_mutex;
- std::condition_variable running_cv;
+ std::condition_variable_any running_cv;
Common::Event running_wait{};
std::atomic_bool running_guard{false};