summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-05-08 09:17:00 +0200
committerdefault <nobody@localhost>2023-05-08 09:17:00 +0200
commit6bad2355ef8d7a4013a73888416c8a90e6b6dab0 (patch)
treee978e3bde2d4d5adede5aadd1e65d55e21bc1a4f
parente2e7bc2d713e469d5af61f58dc85c063bba94e42 (diff)
Moved sem_close() further to the end.
-rw-r--r--httpd.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/httpd.c b/httpd.c
index 334d73d..e8223f5 100644
--- a/httpd.c
+++ b/httpd.c
@@ -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));
}