summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/thread-posix.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-01-12 23:03:04 +0100
committerColin Guthrie <cguthrie@mandriva.org>2010-02-09 22:31:30 +0000
commit7f7455b1be68d2ff5706ccf85eff1a96f7c43d34 (patch)
treebd31a5f4767cb457a34b5f13701d97a992879a78 /src/pulsecore/thread-posix.c
parent66ddeede9ea02cc97178d42c7be18067519eed8f (diff)
once: make once related variables volatile
Diffstat (limited to 'src/pulsecore/thread-posix.c')
-rw-r--r--src/pulsecore/thread-posix.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/pulsecore/thread-posix.c b/src/pulsecore/thread-posix.c
index fdab270f..bc0d6e33 100644
--- a/src/pulsecore/thread-posix.c
+++ b/src/pulsecore/thread-posix.c
@@ -80,11 +80,9 @@ pa_thread* pa_thread_new(pa_thread_func_t thread_func, void *userdata) {
pa_assert(thread_func);
- t = pa_xnew(pa_thread, 1);
+ t = pa_xnew0(pa_thread, 1);
t->thread_func = thread_func;
t->userdata = userdata;
- t->joined = FALSE;
- pa_atomic_store(&t->running, 0);
if (pthread_create(&t->id, NULL, internal_thread_func, t) < 0) {
pa_xfree(t);
@@ -135,10 +133,8 @@ pa_thread* pa_thread_self(void) {
/* This is a foreign thread, let's create a pthread structure to
* make sure that we can always return a sensible pointer */
- t = pa_xnew(pa_thread, 1);
+ t = pa_xnew0(pa_thread, 1);
t->id = pthread_self();
- t->thread_func = NULL;
- t->userdata = NULL;
t->joined = TRUE;
pa_atomic_store(&t->running, 2);