27 lines
502 B
C
27 lines
502 B
C
#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) {}
|