From 5a1231f713ef315d73912e0630a4d8180e8b1748 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Wed, 6 May 2020 20:06:52 +0200 Subject: [PATCH] :bug: Window cond locks --- src/lib/shred.c | 8 ++++---- util | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/shred.c b/src/lib/shred.c index fae26470..de943664 100644 --- a/src/lib/shred.c +++ b/src/lib/shred.c @@ -230,9 +230,9 @@ struct ThreadLauncher *tl = data; MUTEX_TYPE mutex = tl->mutex; const M_Object me = vm->shreduler->list->self->info->me; ++me->ref; - MUTEX_LOCK(mutex); + MUTEX_COND_LOCK(mutex); THREAD_COND_SIGNAL(FORK_COND(me)); - MUTEX_UNLOCK(mutex); + MUTEX_COND_UNLOCK(mutex); while(fork_running(vm, me)) { vm_run(vm); ++vm->bbq->pos; @@ -253,10 +253,10 @@ ANN void fork_launch(const M_Object o, const m_uint sz) { MUTEX_SETUP(FORK_MUTEX(o)); THREAD_COND_SETUP(FORK_COND(o)); struct ThreadLauncher tl = { .mutex=FORK_MUTEX(o), .cond=FORK_COND(o), .vm=ME(o)->info->vm }; - MUTEX_LOCK(tl.mutex); + MUTEX_COND_LOCK(tl.mutex); THREAD_CREATE(FORK_THREAD(o), fork_run, &tl); THREAD_COND_WAIT(FORK_COND(o), tl.mutex); - MUTEX_UNLOCK(tl.mutex); + MUTEX_COND_UNLOCK(tl.mutex); THREAD_COND_CLEANUP(FORK_COND(o)); MUTEX_CLEANUP(FORK_MUTEX(o)); } diff --git a/util b/util index 937c8243..9cad8647 160000 --- a/util +++ b/util @@ -1 +1 @@ -Subproject commit 937c824377a2f609a0fa17869b04935301841427 +Subproject commit 9cad8647ebfe4024c2fb262fa42a2096d84fb183 -- 2.43.0