Skip to content

Commit

Permalink
async: fix re_async_cancel mqueue handling (#995)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sreimers authored Oct 31, 2023
1 parent aa13ac7 commit 4bb4a34
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/async/async.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 4bb4a34

Please sign in to comment.