aboutsummaryrefslogtreecommitdiffstats
path: root/src/worker.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/worker.c')
-rw-r--r--src/worker.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/worker.c b/src/worker.c
index 6f94997..8354ad6 100644
--- a/src/worker.c
+++ b/src/worker.c
@@ -81,10 +81,17 @@ jalv_worker_init(Jalv* jalv,
void
jalv_worker_finish(JalvWorker* worker)
{
+ if (worker->threaded) {
+ zix_sem_post(&worker->sem);
+ zix_thread_join(worker->thread, NULL);
+ }
+}
+
+void
+jalv_worker_destroy(JalvWorker* worker)
+{
if (worker->requests) {
if (worker->threaded) {
- zix_sem_post(&worker->sem);
- zix_thread_join(worker->thread, NULL);
zix_ring_free(worker->requests);
}
zix_ring_free(worker->responses);