From: Jérémie Astor Date: Tue, 3 Dec 2019 16:30:14 +0000 (+0100) Subject: :art: Make vm_running recursive X-Git-Tag: nightly~2070^2~8 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=abbea761bb3274b1e08ae8ccbf572f20d7a39911;p=gwion.git :art: Make vm_running recursive --- diff --git a/src/vm/vm.c b/src/vm/vm.c index c3456ae8..f251ca8a 100644 --- a/src/vm/vm.c +++ b/src/vm/vm.c @@ -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) {