Skip to content
Snippets Groups Projects
Commit b31c1fd8 authored by Max Barrett's avatar Max Barrett
Browse files

Setting stuff up

parent a98f0870
No related branches found
No related tags found
No related merge requests found
#include "threadpool.h"
#include "list.h"
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
struct thread_pool {
pthread_mutex_t m;
struct list global_queue;
bool shutdown;
};
struct future {
fork_join_task_t task;
void* args;
void* result;
};
struct thread_pool * thread_pool_new(int nthreads) {
struct thread_pool *threads = malloc(sizeof(struct thread_pool));
return threads;
}
void thread_pool_shutdown_and_destroy(struct thread_pool *threadpool) {
return;
}
void * future_get(struct future *future) {
return future;
}
void future_free(struct future *future) {
return;
}
struct future * thread_pool_submit(struct thread_pool *pool, fork_join_task_t task, void * data) {
struct future *future = malloc(sizeof(struct future));
return future;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment