summaryrefslogtreecommitdiffstats
path: root/src/android/app
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2023-01-26 05:35:58 +0100
committerbunnei <bunneidev@gmail.com>2023-06-03 09:05:29 +0200
commitd6a41b32905a0ab95b63c1df6480b715ce21ade7 (patch)
treedb40ac5a05baef85d9c204081178350988cee2f2 /src/android/app
parentandroid: jni: native: Refactor locking for is_running. (diff)
downloadyuzu-d6a41b32905a0ab95b63c1df6480b715ce21ade7.tar
yuzu-d6a41b32905a0ab95b63c1df6480b715ce21ade7.tar.gz
yuzu-d6a41b32905a0ab95b63c1df6480b715ce21ade7.tar.bz2
yuzu-d6a41b32905a0ab95b63c1df6480b715ce21ade7.tar.lz
yuzu-d6a41b32905a0ab95b63c1df6480b715ce21ade7.tar.xz
yuzu-d6a41b32905a0ab95b63c1df6480b715ce21ade7.tar.zst
yuzu-d6a41b32905a0ab95b63c1df6480b715ce21ade7.zip
Diffstat (limited to 'src/android/app')
-rw-r--r--src/android/app/src/main/jni/native.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/android/app/src/main/jni/native.cpp b/src/android/app/src/main/jni/native.cpp
index 119c7cd01..e1b771468 100644
--- a/src/android/app/src/main/jni/native.cpp
+++ b/src/android/app/src/main/jni/native.cpp
@@ -126,6 +126,7 @@ public:
}
void HaltEmulation() {
+ std::scoped_lock lock(mutex);
is_running = false;
cv.notify_one();
}
@@ -145,7 +146,8 @@ public:
while (true) {
{
std::unique_lock lock(mutex);
- if (cv.wait_for(lock, std::chrono::seconds(1), [&]() { return !is_running; })) {
+ if (cv.wait_for(lock, std::chrono::milliseconds(100),
+ [&]() { return !is_running; })) {
// Emulation halted.
break;
}