]> git.kaiwu.me - klib.git/commitdiff
forgot the header file
authorHeng Li <lh3@me.com>
Sat, 2 Nov 2013 12:26:41 +0000 (08:26 -0400)
committerHeng Li <lh3@me.com>
Sat, 2 Nov 2013 12:26:41 +0000 (08:26 -0400)
For kt_for() it is actually not needed.

kthread.h [new file with mode: 0644]

diff --git a/kthread.h b/kthread.h
new file mode 100644 (file)
index 0000000..ee9896c
--- /dev/null
+++ b/kthread.h
@@ -0,0 +1,23 @@
+#ifndef KTHREAD_H
+#define KTHREAD_H
+
+#define KT_MAX_TASKS 1024
+
+struct kthread_t;
+typedef struct kthread_t kthread_t;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+kthread_t *kt_init(int n_threads);
+int kt_spawn(kthread_t *t, int n, void (*func)(void*,int,int), void *data);
+void kt_sync(kthread_t *t);
+
+void kt_for(int n_threads, int n, void (*func)(void*,int,int), void *data);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif