From 0ed9dfdd830789b2c28b06d34efc00a00f47f34f Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Tue, 31 Oct 2023 12:38:07 +0100 Subject: [PATCH 1/3] async: fix re_async_cancel mqueue handling Since we can't clear/revert a mqueue_push, free list handling has always be done by async queueh and not within re_async_cancel. --- src/async/async.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/async/async.c b/src/async/async.c index 7d37ac7f8..8610abb1d 100644 --- a/src/async/async.c +++ b/src/async/async.c @@ -333,7 +333,7 @@ void re_async_cancel(struct re_async *async, intptr_t id) w->workh = NULL; w->cb = NULL; w->arg = mem_deref(w->arg); - list_move(&w->le, &async->freel); + /* No move to free list since queueh must always handled */ mtx_unlock(w->mtx); } @@ -351,7 +351,7 @@ void re_async_cancel(struct re_async *async, intptr_t id) w->workh = NULL; w->cb = NULL; w->arg = mem_deref(w->arg); - list_move(&w->le, &async->freel); + /* No move to free list since queueh must always handled */ mtx_unlock(w->mtx); } From 9ddd4b0d968f8753621925607b2b94632dceb044 Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Tue, 31 Oct 2023 12:44:01 +0100 Subject: [PATCH 2/3] fix workl handling --- src/async/async.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/async/async.c b/src/async/async.c index 8610abb1d..8f8a248f4 100644 --- a/src/async/async.c +++ b/src/async/async.c @@ -333,7 +333,7 @@ void re_async_cancel(struct re_async *async, intptr_t id) w->workh = NULL; w->cb = NULL; w->arg = mem_deref(w->arg); - /* No move to free list since queueh must always handled */ + list_move(&w->le, &async->freel); mtx_unlock(w->mtx); } @@ -351,7 +351,8 @@ void re_async_cancel(struct re_async *async, intptr_t id) w->workh = NULL; w->cb = NULL; w->arg = mem_deref(w->arg); - /* No move to free list since queueh must always handled */ + /* No move to free list since queueh must always handled if + * mqueu_push is called*/ mtx_unlock(w->mtx); } From df90a354cc8e091bad003320d59343bb9949d9a0 Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Tue, 31 Oct 2023 12:49:11 +0100 Subject: [PATCH 3/3] fix wording --- src/async/async.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/async/async.c b/src/async/async.c index 8f8a248f4..934ad0a02 100644 --- a/src/async/async.c +++ b/src/async/async.c @@ -352,7 +352,7 @@ void re_async_cancel(struct re_async *async, intptr_t id) w->cb = NULL; w->arg = mem_deref(w->arg); /* No move to free list since queueh must always handled if - * mqueu_push is called*/ + * mqueue_push is called */ mtx_unlock(w->mtx); }