mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-12 13:30:10 -05:00
once: make once related variables volatile
This commit is contained in:
parent
15a3018bda
commit
73ae1fce00
4 changed files with 5 additions and 10 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue