From 18301dfca56ba8545549e80f84423d83a46c6b64 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 2 Oct 2007 20:26:08 +0000 Subject: a lot of minor cleanups git-svn-id: file:///home/lennart/svn/public/libsydney/trunk@36 9ba3c220-e4d3-45a2-8aa3-73fcc9aff6ce --- src/thread.h | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'src/thread.h') diff --git a/src/thread.h b/src/thread.h index ddd2604..66071e1 100644 --- a/src/thread.h +++ b/src/thread.h @@ -1,28 +1,27 @@ #ifndef foosydneythreadhfoo #define foosydneythreadhfoo -typedef struct sa_thread sa_thread_t; +#include "macro.h" + +typedef struct sa_thread sa_thread; 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); +sa_thread* sa_thread_new(sa_thread_func_t thread_func, void *userdata); +void sa_thread_free(sa_thread *t); +int sa_thread_join(sa_thread *t); +sa_bool_t sa_thread_is_running(sa_thread *t); +sa_thread *sa_thread_self(void); void sa_thread_yield(void); -int sa_thread_is_self(sa_thread_t *t); - -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; +void* sa_thread_get_data(sa_thread *t); +void sa_thread_set_data(sa_thread *t, void *userdata); -typedef void (*sa_free_func_t) (void *data); +typedef struct sa_tls sa_tls; -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); +sa_tls* sa_tls_new(sa_free_cb_t free_cb); +void sa_tls_free(sa_tls *t); +void * sa_tls_get(sa_tls *t); +void *sa_tls_set(sa_tls *t, void *userdata); #endif -- cgit