Files
cse-130-http-server/src/threadpool.c
T

27 lines
502 B
C
Raw Normal View History

2026-05-24 23:24:25 -07:00
#include "threadpool.h"
#include <stdlib.h>
#include <threads.h>
struct thread_pool_queue {
Task task;
void *arg;
struct thread_pool_queue *next;
};
struct _ThreadPool {
size_t nthreads;
thrd_t *threads;
struct thread_pool_queue *queue;
};
ThreadPool *make_thread_pool(int parallelism) {
ThreadPool *pool = malloc(sizeof(ThreadPool));
pool->nthreads = parallelism;
}
void destroy_thread_pool(ThreadPool *pool) {}
void thread_pool_enqueue(Task task, void *arg) {}