From: Jérémie Astor Date: Mon, 6 Sep 2021 10:27:51 +0000 (+0200) Subject: :art: Fix Shred.exit X-Git-Tag: nightly~470^2~5 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=eec7a21d6615a671eaaebd65394fc8b43b7de9af;p=gwion.git :art: Fix Shred.exit --- 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; }