From 872f56dc7ec43cb1511ef0d25c1736a373b3c2e2 Mon Sep 17 00:00:00 2001 From: Tanu Kaskinen Date: Mon, 2 Apr 2012 15:01:05 +0300 Subject: mainloop: Don't care about the mainloop state variable when waking up the mainloop. If the mainloop is just about to enter polling, but m->state is not POLLING yet when some other thread calls pa_mainloop_wakeup(), the mainloop will not be woken up. It's safe to write to the wakeup pipe at any time, so let's just remove the check. --- src/pulse/mainloop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pulse/mainloop.c b/src/pulse/mainloop.c index 179465a3..aec082c0 100644 --- a/src/pulse/mainloop.c +++ b/src/pulse/mainloop.c @@ -772,7 +772,7 @@ void pa_mainloop_wakeup(pa_mainloop *m) { char c = 'W'; pa_assert(m); - if (m->wakeup_pipe[1] >= 0 && m->state == STATE_POLLING) { + if (m->wakeup_pipe[1] >= 0) { pa_write(m->wakeup_pipe[1], &c, sizeof(c), &m->wakeup_pipe_type); pa_atomic_store(&m->wakeup_requested, TRUE); } -- cgit v1.2.3