pa_thread_func_t thread_func;
void *userdata;
pa_atomic_t running;
- pa_bool_t joined;
+ bool joined;
char *name;
};
pa_xfree(t);
}
+void pa_thread_free_nojoin(pa_thread *t) {
+ pa_assert(t);
+
+ pa_xfree(t->name);
+ pa_xfree(t);
+}
+
int pa_thread_join(pa_thread *t) {
pa_assert(t);
pa_assert(t->thread_func);
if (t->joined)
return -1;
- t->joined = TRUE;
+ t->joined = true;
return pthread_join(t->id, NULL);
}
t = pa_xnew0(pa_thread, 1);
t->id = pthread_self();
- t->joined = TRUE;
+ t->joined = true;
pa_atomic_store(&t->running, 2);
PA_STATIC_TLS_SET(current_thread, t);