aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/worker_queue.c
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-07-05 15:30:57 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-07-05 16:18:05 +0200
commit8465f8181eda45e3d6cc5d6c3d08ca36db04763b (patch)
tree1ca1d03cfe373a1ca28ee021d9b3ec73781fb487 /src/worker_queue.c
parentsanitize #include-s (diff)
downloadcimple-8465f8181eda45e3d6cc5d6c3d08ca36db04763b.tar.gz
cimple-8465f8181eda45e3d6cc5d6c3d08ca36db04763b.zip
tcp_server: keep track of client threads
This is a major change, obviously; brought to me by Valgrind, which noticed that we don't actually clean up after cimple-client threads. For a more thorough explanation, please see the added comment in tcp_server.c.
Diffstat (limited to '')
-rw-r--r--src/worker_queue.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/src/worker_queue.c b/src/worker_queue.c
index fd449c1..867ad90 100644
--- a/src/worker_queue.c
+++ b/src/worker_queue.c
@@ -9,12 +9,10 @@
#include "log.h"
#include "net.h"
-#include <pthread.h>
#include <stdlib.h>
#include <sys/queue.h>
struct worker {
- pthread_t thread;
int fd;
SIMPLEQ_ENTRY(worker) entries;
};
@@ -27,7 +25,6 @@ int worker_create(struct worker **_entry, int fd)
return -1;
}
- entry->thread = pthread_self();
entry->fd = fd;
*_entry = entry;
@@ -36,8 +33,6 @@ int worker_create(struct worker **_entry, int fd)
void worker_destroy(struct worker *entry)
{
- log("Waiting for worker %d thread to exit\n", entry->fd);
- pthread_errno_if(pthread_join(entry->thread, NULL), "pthread_join");
net_close(entry->fd);
free(entry);
}