summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2006-09-04 22:15:15 +0000
committerLennart Poettering <lennart@poettering.net>2006-09-04 22:15:15 +0000
commit6bbfb43f2ac597c2d1ba95b0c4b7c9619dcb9a35 (patch)
tree6a15e920c3d4ff488832db76a85bf5188c6f6494
parent3be920d9aec656e7e34672558e85ba025a4059d0 (diff)
add accessor functions for the userdata attached to a pa_thread object
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1371 fefdeb5f-60dc-0310-8127-8f9354f1896f
-rw-r--r--src/pulsecore/thread-posix.c12
-rw-r--r--src/pulsecore/thread.h3
2 files changed, 15 insertions, 0 deletions
diff --git a/src/pulsecore/thread-posix.c b/src/pulsecore/thread-posix.c
index 1b9a94a3f..a2cb9b56c 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 8aabecfa1..e50a707f3 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);