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,15 +1120,13 @@ public:
|
|||||||
void terminate(){
|
void terminate(){
|
||||||
if(_state == THREAD_RUNNING || _state == THREAD_SUSPENDED){
|
if(_state == THREAD_RUNNING || _state == THREAD_SUSPENDED){
|
||||||
keyboardInterrupt();
|
keyboardInterrupt();
|
||||||
while(_state != THREAD_FINISHED) {
|
|
||||||
#ifdef __EMSCRIPTEN__
|
#ifdef __EMSCRIPTEN__
|
||||||
emscripten_sleep(20);
|
// no way to terminate safely
|
||||||
#else
|
#else
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(20));
|
while(_state != THREAD_FINISHED);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void suspend(){
|
void suspend(){
|
||||||
if(_state != THREAD_RUNNING) UNREACHABLE();
|
if(_state != THREAD_RUNNING) UNREACHABLE();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user