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.
This commit is contained in:
Tanu Kaskinen 2012-04-02 15:01:05 +03:00 committed by Tanu Kaskinen
parent 58de999a31
commit 872f56dc7e

View file

@ -772,7 +772,7 @@ void pa_mainloop_wakeup(pa_mainloop *m) {
char c = 'W'; char c = 'W';
pa_assert(m); 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_write(m->wakeup_pipe[1], &c, sizeof(c), &m->wakeup_pipe_type);
pa_atomic_store(&m->wakeup_requested, TRUE); pa_atomic_store(&m->wakeup_requested, TRUE);
} }