Add pthread_once() equivalent support.

git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1357 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Pierre Ossman 2006-09-01 18:39:55 +00:00
parent 3571bf1699
commit f84c65ed86
3 changed files with 55 additions and 31 deletions

View file

@ -24,9 +24,13 @@
#include <pulse/def.h>
#define PA_THREAD_ONCE_INIT 0
typedef struct pa_thread pa_thread;
typedef void (*pa_thread_func_t) (void *userdata);
typedef void (*pa_thread_once_func_t) (void);
typedef unsigned int pa_thread_once_t;
pa_thread* pa_thread_new(pa_thread_func_t thread_func, void *userdata);
void pa_thread_free(pa_thread *t);
@ -34,6 +38,7 @@ int pa_thread_join(pa_thread *t);
int pa_thread_is_running(pa_thread *t);
pa_thread *pa_thread_self(void);
void pa_thread_yield(void);
void pa_thread_once(pa_thread_once_t *control, pa_thread_once_func_t once_func);
typedef struct pa_tls pa_tls;