<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#c14">Comment # 14</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#c13">comment #13</a>)
<span class="quote">> (In reply to <a href="show_bug.cgi?id=56735#c12">comment #12</a>)
> [...]
> > 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.</span >
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.</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>