From eec7a21d6615a671eaaebd65394fc8b43b7de9af Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Mon, 6 Sep 2021 12:27:51 +0200 Subject: [PATCH] :art: Fix Shred.exit --- src/lib/shred.c | 9 ++++----- src/vm/vm.c | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/lib/shred.c b/src/lib/shred.c index 0403d8bc..b3cb6564 100644 --- a/src/lib/shred.c +++ b/src/lib/shred.c @@ -59,7 +59,8 @@ ANN M_Object new_fork(const VM_Shred shred, const VM_Code code, const Type t) { static MFUN(gw_shred_exit) { const VM_Shred s = ME(o); - vm_shred_exit(s); + if((m_int)s->tick->prev != -1) + shreduler_remove(s->tick->shreduler, s, true); } static MFUN(vm_shred_id) { @@ -153,10 +154,8 @@ describe_name(, s->info->orig->name) describe_name(_code, s->code->name) describe_path_and_dir(_code, s->code->name) static DTOR(shred_dtor) { - if (ME(o)) { - VM_Shred s = ME(o); - free_vm_shred(s); - } + VM_Shred s = ME(o); + free_vm_shred(s); } static MFUN(shred_lock) { if(ME(o)->tick) MUTEX_LOCK(ME(o)->tick->shreduler->mutex); } diff --git a/src/vm/vm.c b/src/vm/vm.c index 922ef5cb..fc9f297f 100644 --- a/src/vm/vm.c +++ b/src/vm/vm.c @@ -263,7 +263,7 @@ ANN /*static inline */ VM_Shred init_spork_shred(const VM_Shred shred, sh->tick->parent = shred->tick; if (!shred->tick->child.ptr) vector_init(&shred->tick->child); vector_add(&shred->tick->child, (vtype)sh); - vector_add(&shred->gc, (vtype)sh->info->me); +// vector_add(&shred->gc, (vtype)sh->info->me); return sh; } -- 2.43.0