summaryrefslogtreecommitdiffstats
path: root/thread.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2007-05-17 22:22:53 +0000
committerLennart Poettering <lennart@poettering.net>2007-05-17 22:22:53 +0000
commitbef6322859a5dc01e35d884de7afd2eabb1d9e4d (patch)
tree6431f409747005fca20998fe518c174c909fd385 /thread.h
parentc58ce0879c1cabfd31dd8657d2594d78f13b1360 (diff)
at basic locking/threading support
git-svn-id: file:///home/lennart/svn/public/libsydney/trunk@26 9ba3c220-e4d3-45a2-8aa3-73fcc9aff6ce
Diffstat (limited to 'thread.h')
-rw-r--r--thread.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/thread.h b/thread.h
new file mode 100644
index 0000000..1a61e7a
--- /dev/null
+++ b/thread.h
@@ -0,0 +1,27 @@
+#ifndef foosydneythreadhfoo
+#define foosydneythreadhfoo
+
+typedef struct sa_thread sa_thread_t;
+
+typedef void (*sa_thread_func_t) (void *userdata);
+
+sa_thread_t* sa_thread_new(sa_thread_func_t sa_thread_func, void *userdata);
+void sa_thread_free(sa_thread_t *t);
+int sa_thread_join(sa_thread_t *t);
+int sa_thread_is_running(sa_thread_t *t);
+sa_thread_t *sa_thread_self(void);
+void sa_thread_yield(void);
+
+void* sa_thread_get_data(sa_thread_t *t);
+void sa_thread_set_data(sa_thread_t *t, void *userdata);
+
+typedef struct sa_tls sa_tls_t;
+
+typedef void (*sa_free_func_t) (void *data);
+
+sa_tls_t* sa_tls_new(sa_free_func_t f);
+void sa_tls_free(sa_tls_t *t);
+void * sa_tls_get(sa_tls_t *t);
+void *sa_tls_set(sa_tls_t *t, void *userdata);
+
+#endif