void pa_thread_free(pa_thread *t) { assert(t); pa_thread_join(t); CloseHandle(t->thread); pa_xfree(t); }
void pa_threaded_mainloop_stop(pa_threaded_mainloop *m) { pa_assert(m); if (!m->thread || !pa_thread_is_running(m->thread)) return; /* Make sure that this function is not called from the helper thread */ pa_assert(!in_worker(m)); pa_mutex_lock(m->mutex); pa_mainloop_quit(m->real_mainloop, 0); pa_mutex_unlock(m->mutex); pa_thread_join(m->thread); }