[pulseaudio-tickets] [Bug 56735] pa_mainloop_quit() can't make pa_mainloop_run exit

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Nov 15 08:21:09 PST 2012


https://bugs.freedesktop.org/show_bug.cgi?id=56735

Tanu Kaskinen <tanuk at iki.fi> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #8 from Tanu Kaskinen <tanuk at iki.fi> ---
The brokenness of pa_mainloop_wakeup() has now been fixed:
http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=872f56dc7ec43cb1511ef0d25c1736a373b3c2e2

Yupeng, unfortunately I've come to the conclusion (after getting feedback from
Arun) that it's actually not supported to call pa_mainloop_quit() from a
different thread. It will probably continue working quite well in practice in
3.0 (better than 2.x now that the pa_mainloop_wakeup() bug has been fixed), but
it will be completely broken in 4.0, because the pa_mainloop_wakeup() call will
be removed from pa_mainloop_quit(). The thing is that pa_mainloop_quit() is not
a thread-safe function, because it directly modifies the mainloop state which
is supposed to be accessed only from the thread where the mainloop runs. The
only thread-safe function in the pa_mainloop API is pa_mainloop_wakeup().

If you really need to quit the mainloop from a different thread, create an IO
event (using a pipe, for example) that you trigger from the other thread.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pulseaudio-bugs/attachments/20121115/96c6ca24/attachment.html>


More information about the pulseaudio-bugs mailing list