<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - pa_mainloop_quit() can't make pa_mainloop_run exit"
href="https://bugs.freedesktop.org/show_bug.cgi?id=56735#c12">Comment # 12</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - pa_mainloop_quit() can't make pa_mainloop_run exit"
href="https://bugs.freedesktop.org/show_bug.cgi?id=56735">bug 56735</a>
from <span class="vcard"><a class="email" href="mailto:changyp6@gmail.com" title="Yupeng Chang <changyp6@gmail.com>"> <span class="fn">Yupeng Chang</span></a>
</span></b>
<pre>(In reply to <a href="show_bug.cgi?id=56735#c11">comment #11</a>)
<span class="quote">> (In reply to <a href="show_bug.cgi?id=56735#c10">comment #10</a>)
> > 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.</span >
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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>