Files
cse-130-http-server/threadpool.h
T

18 lines
431 B
C
Raw Normal View History

2026-05-24 23:24:25 -07:00
#ifndef INCLUDED_THREAD_POOL_H
#define INCLUDED_THREAD_POOL_H
2026-05-25 17:25:50 -07:00
#include <signal.h> // IWYU pragma: keep
#include <stddef.h>
2026-05-24 23:24:25 -07:00
typedef struct _ThreadPool ThreadPool;
typedef void (*Task)(void *);
2026-05-25 17:37:16 -07:00
typedef void (*FreeFunc)(void *);
2026-05-24 23:24:25 -07:00
2026-05-25 17:25:50 -07:00
ThreadPool *make_thread_pool(size_t parallelism, sigset_t sig_mask);
2026-05-24 23:24:25 -07:00
void destroy_thread_pool(ThreadPool *pool);
2026-05-25 17:37:16 -07:00
void thread_pool_enqueue(ThreadPool *pool, Task task, void *arg, FreeFunc ff);
2026-05-24 23:24:25 -07:00
#endif