From 4bb4a34a225c60911f7a59ef627804d0610e5485 Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Tue, 31 Oct 2023 13:26:18 +0100 Subject: [PATCH] async: fix re_async_cancel mqueue handling (#995) 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. Otherwise job is reused and maybe executed twice or early. --- src/async/async.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/async/async.c b/src/async/async.c index 7d37ac7f8..934ad0a02 100644 --- a/src/async/async.c +++ b/src/async/async.c @@ -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); - list_move(&w->le, &async->freel); + /* No move to free list since queueh must always handled if + * mqueue_push is called */ mtx_unlock(w->mtx); }