]> code.delx.au - pulseaudio/commitdiff
threaded-mainloop: Properly initialise m->n_waiting_for_accept to prevent deadlock
authorDaniel T Chen <crimsun@ubuntu.com>
Tue, 5 Jan 2010 02:44:37 +0000 (21:44 -0500)
committerLennart Poettering <lennart@poettering.net>
Tue, 5 Jan 2010 18:57:16 +0000 (19:57 +0100)
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

src/pulse/thread-mainloop.c

index 14ed92648d6cb45a1666bc409cd7e3496e3ee087..16934044874f6bcf88cd6f72f9700f674f38039f 100644 (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);
 
     m->n_waiting = 0;
+    m->n_waiting_for_accept = 0;
 
     return m;
 }