[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 09:56:09 PST 2012
https://bugs.freedesktop.org/show_bug.cgi?id=56735
--- Comment #14 from Yupeng Chang <changyp6 at gmail.com> ---
(In reply to comment #13)
> (In reply to comment #12)
> [...]
> > Thanks for your advise.
> > I have considered using threaded-mainloop, but there's one thing made me
> > give up.
> > My program is a real-time recording program, other threads are set to RT
> > thread.
> > There isn't an API of threaded-mainloop to set it to run as a RT thread.
> [...]
>
> You can do this in the context state callback before you actually connect
> the stream, which is well before the audio work actually begins.
I think the best way to do so, is to send a special message, for example
"quit", to m->wakeup_pipe[1], in the poll function, when this special message
is received, m->quit is set to true, then poll quit cleanly.
In this model, pa_mainloop_quit() just "tells" pa_mainloop_run() to quit, the
former API won't modify any private data of PaMainloop.
B.T.W signal handler is not elegant to make mainloop quit. it's just a hack
method.
--
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/21519a74/attachment.html>
More information about the pulseaudio-bugs
mailing list