blueloveTH hace 3 años
padre
commit
9c5284a381
Se han modificado 1 ficheros con 2 adiciones y 4 borrados
  1. 2 4
      src/vm.h

+ 2 - 4
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
-            }
         }
     }