summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel T Chen <crimsun@ubuntu.com>2010-01-04 21:44:37 -0500
committerWim Taymans <wtaymans@redhat.com>2014-04-02 14:36:10 +0200
commit1efa1b75a0d9932080cd61ca079579bb72e2328d (patch)
treeb04c03932eb3fd3e59be8d010e5ef32a11a676a3
parent6f50d7e427d86f54f2dd75ee1d3cdcda544da2dc (diff)
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
-rw-r--r--src/pulse/thread-mainloop.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/pulse/thread-mainloop.c b/src/pulse/thread-mainloop.c
index 14ed92648..169340448 100644
--- a/src/pulse/thread-mainloop.c
+++ b/src/pulse/thread-mainloop.c
@@ -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;
}