]> Nishi Git Mirror - gwion.git/commitdiff
:art: Make vm_running recursive
authorJérémie Astor <astor.jeremie@wanadoo.fr>
Tue, 3 Dec 2019 16:30:14 +0000 (17:30 +0100)
committerJérémie Astor <astor.jeremie@wanadoo.fr>
Tue, 3 Dec 2019 16:30:14 +0000 (17:30 +0100)
src/vm/vm.c

index c3456ae8beeece1def606785eeabe053b64cfe4c..f251ca8afe3b1d8b19e93fa2c334105fc669e92a 100644 (file)
@@ -79,9 +79,11 @@ ANN void vm_unlock(VM *vm) {
 }
 
 ANN m_bool vm_running(VM *vm) {
-  do if(!vm->shreduler->bbq->is_running) return 0;
-  while((vm = vm->parent));
-  return 1;
+  if(!vm->shreduler->bbq->is_running)
+    return 0;
+  if(!vm->parent)
+    return 1;
+  return vm->shreduler->bbq->is_running = vm_running(vm->parent);
 }
 
 ANN static void vm_fork(VM* src, const VM_Shred shred) {