mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-22 20:40:18 +00:00
Update vm.h
This commit is contained in:
parent
f210de9675
commit
9c5284a381
6
src/vm.h
6
src/vm.h
@ -1120,13 +1120,11 @@ public:
|
||||
void terminate(){
|
||||
if(_state == THREAD_RUNNING || _state == THREAD_SUSPENDED){
|
||||
keyboardInterrupt();
|
||||
while(_state != THREAD_FINISHED) {
|
||||
#ifdef __EMSCRIPTEN__
|
||||
emscripten_sleep(20);
|
||||
// no way to terminate safely
|
||||
#else
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(20));
|
||||
while(_state != THREAD_FINISHED);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user