From eac073d479dfbe5ecf9c5fc7180f7b29da6d1298 Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Fri, 21 Dec 2018 03:55:00 +0100 Subject: wip --- src/common/thread.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/common/thread.h (limited to 'src/common/thread.h') diff --git a/src/common/thread.h b/src/common/thread.h new file mode 100644 index 0000000..850d375 --- /dev/null +++ b/src/common/thread.h @@ -0,0 +1,23 @@ +/* + * blogc: A blog compiler. + * Copyright (C) 2014-2018 Rafael G. Martins + * + * This program can be distributed under the terms of the BSD License. + * See the file LICENSE. + */ + +#ifndef _THREAD_H +#define _THREAD_H + +#include + +typedef void* (*bc_thread_func_t) (void *arg); + +typedef struct _bc_thread_t bc_thread_t; + +bc_thread_t* bc_thread_create(bc_thread_func_t func, void *arg, bool detached, + bc_error_t **err); +void bc_thread_join(bc_thread_t *thread, bc_error_t **err); +void bc_thread_free(bc_thread_t *thread); + +#endif /* _THREAD_H */ -- cgit v1.2.3-18-g5258