Skip to content

Commit

Permalink
pool: Close async handle after joining threads
Browse files Browse the repository at this point in the history
Signed-off-by: Cole Miller <[email protected]>
  • Loading branch information
cole-miller committed Aug 16, 2024
1 parent 3842e67 commit 4d602a1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/threadpool.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,8 @@ static void pool_cleanup(pool_t *pool)
uv_cond_destroy(&ts[i].cond);
}

uv_close((uv_handle_t *)&pi->outq_async, NULL);

free(pi->threads);
uv_mutex_destroy(&pi->mutex);
pi->threads_nr = 0;
Expand Down Expand Up @@ -599,7 +601,6 @@ void pool_close(pool_t *pool)
{
pool_impl_t *pi = pool->pi;

uv_close((uv_handle_t *)&pi->outq_async, NULL);
uv_mutex_lock(&pi->mutex);
pi->exiting = true;
uv_mutex_unlock(&pi->mutex);
Expand Down

0 comments on commit 4d602a1

Please sign in to comment.