diff options
Diffstat (limited to 'src/pulsecore')
-rw-r--r-- | src/pulsecore/thread-posix.c | 12 | ||||
-rw-r--r-- | src/pulsecore/thread.h | 3 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/pulsecore/thread-posix.c b/src/pulsecore/thread-posix.c index 1b9a94a3..a2cb9b56 100644 --- a/src/pulsecore/thread-posix.c +++ b/src/pulsecore/thread-posix.c @@ -162,6 +162,18 @@ pa_thread* pa_thread_self(void) { return t; } +void* pa_thread_get_data(pa_thread *t) { + assert(t); + + return t->userdata; +} + +void pa_thread_set_data(pa_thread *t, void *userdata) { + assert(t); + + t->userdata = userdata; +} + void pa_thread_yield(void) { #ifdef HAVE_PTHREAD_YIELD pthread_yield(); diff --git a/src/pulsecore/thread.h b/src/pulsecore/thread.h index 8aabecfa..e50a707f 100644 --- a/src/pulsecore/thread.h +++ b/src/pulsecore/thread.h @@ -40,6 +40,9 @@ 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); +void* pa_thread_get_data(pa_thread *t); +void pa_thread_set_data(pa_thread *t, void *userdata); + typedef struct pa_tls pa_tls; pa_tls* pa_tls_new(pa_free_cb_t free_cb); |