aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/thread.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/thread.h')
-rw-r--r--src/common/thread.h23
1 files changed, 23 insertions, 0 deletions
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 <rafael@rafaelmartins.eng.br>
+ *
+ * This program can be distributed under the terms of the BSD License.
+ * See the file LICENSE.
+ */
+
+#ifndef _THREAD_H
+#define _THREAD_H
+
+#include <stdbool.h>
+
+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 */