summaryrefslogtreecommitdiffstats
path: root/thread.h
blob: 1a61e7ab5bba19107fef7279730619824820bd56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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