summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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:
126 } 126 }
127 127
128 void HaltEmulation() { 128 void HaltEmulation() {
129 std::scoped_lock lock(mutex);
129 is_running = false; 130 is_running = false;
130 cv.notify_one(); 131 cv.notify_one();
131 } 132 }
@@ -145,7 +146,8 @@ public:
145 while (true) { 146 while (true) {
146 { 147 {
147 std::unique_lock lock(mutex); 148 std::unique_lock lock(mutex);
148 if (cv.wait_for(lock, std::chrono::seconds(1), [&]() { return !is_running; })) { 149 if (cv.wait_for(lock, std::chrono::milliseconds(100),
150 [&]() { return !is_running; })) {
149 // Emulation halted. 151 // Emulation halted.
150 break; 152 break;
151 } 153 }