threaded-mainloop: Properly initialise m->n_waiting_for_accept to prevent deadlock

Compiler optimisations have been seen to initialise
m->n_waiting_for_accept to a positive non-zero value, so the while() in
pa_threaded_mainloop_signal() never proceeds. Fix this by properly
initializing m->n_waiting_for_accept in pa_threaded_mainloop_new().

Patch from Iain Bucław.

https://bugs.launchpad.net/bugs/502992
This commit is contained in:
Daniel T Chen 2010-01-04 21:44:37 -05:00 committed by Lennart Poettering
parent 66e1a2d051
commit a2418effe7

View file

@ -116,6 +116,7 @@ pa_threaded_mainloop *pa_threaded_mainloop_new(void) {
pa_mainloop_set_poll_func(m->real_mainloop, poll_func, m->mutex); pa_mainloop_set_poll_func(m->real_mainloop, poll_func, m->mutex);
m->n_waiting = 0; m->n_waiting = 0;
m->n_waiting_for_accept = 0;
return m; return m;
} }