[PATCH 4/5] mainloop: Write to the wakeup pipe unconditionally when waking up the mainloop.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/pulse/mainloop.c b/src/pulse/mainloop.c
index 160ba9c..8ac8f06 100644
--- a/src/pulse/mainloop.c
+++ b/src/pulse/mainloop.c
@@ -774,10 +774,8 @@ void pa_mainloop_wakeup(pa_mainloop *m) {
     char c = 'W';
     pa_assert(m);
 
-    if (m->state == STATE_POLLING) {
-        pa_write(m->wakeup_pipe[1], &c, sizeof(c), &m->wakeup_pipe_type);
-        pa_atomic_store(&m->wakeup_requested, TRUE);
-    }
+    pa_write(m->wakeup_pipe[1], &c, sizeof(c), &m->wakeup_pipe_type);
+    pa_atomic_store(&m->wakeup_requested, TRUE);
 }
 
 static void clear_wakeup(pa_mainloop *m) {
-- 
1.7.8



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux