Moved sem_close() further to the end.

This commit is contained in:
default 2023-05-08 09:17:00 +02:00
parent e2e7bc2d71
commit 6bad2355ef

View File

@ -354,10 +354,6 @@ void job_wait(xs_val **job)
/* unlock the mutex */
pthread_mutex_unlock(&job_mutex);
}
if (!*job) {
sem_close(job_sem);
}
}
@ -568,5 +564,7 @@ void httpd(void)
job_fifo = xs_free(job_fifo);
pthread_mutex_unlock(&job_mutex);
sem_close(job_sem);
srv_log(xs_fmt("httpd stop %s:%d", address, port));
}