[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:19:09 PST 2012


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

--- Comment #12 from Yupeng Chang <changyp6 at gmail.com> ---
(In reply to comment #11)
> (In reply to comment #10)
> > I designed my program based on the callback mechanism of pa_mainloop, so I
> > didn't use threaded-mainloop.
> 
> The threaded mainloop is also going to end up calling those callbacks and it
> fits your model of usage a lot better, so if you can, you really should look
> into using it.

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.

So I decided to use pa_mainloop and wrap it into a thread class which I can
control all the thread preferences.

It's my fault that I didn't read the source code carefully.

There's just one step close to the success.
The only way I can think of is to register a signal handler in the same thread
of pa_mainloop_run, in this handler, pa_mainloop_quit is called, and trigger
this signal in 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/32ef922a/attachment.html>


More information about the pulseaudio-bugs mailing list