<div dir="ltr">It seems that nothing else change it's status, i ran the loop for more than 15 minutes and still, no change of status.<div><br></div><div>Killian Matter</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le jeu. 14 janv. 2021 à 10:02, Dennis Buteyn <<a href="mailto:dennis.buteyn@xorcom.com">dennis.buteyn@xorcom.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<p><font face="Liberation Sans">That loop is equivalent to:</font></p>
<p><font face="Liberation Sans">audiohook->status =
AST_AUDIOHOOK_STATUS_SHUTDOWN;<br>
while (audiohook->status != AST_AUDIOHOOK_STATUS_DONE) {<br>
sleep(...);<br>
}</font></p>
<p><font face="Liberation Sans">Something else (in another thread)
must change the status in order for that loop to terminate.</font></p>
<p><font face="Liberation Sans">Side note: that struct member
probably should be marked volatile, I can imagine very eager
compilers </font><font face="Liberation Sans"><font face="Liberation Sans">assuming that status never changes and
</font>optimizing that code into a real infinite loop.<br>
</font></p>
<pre cols="72">Dennis Buteyn
Xorcom Ltd</pre>
<div>On 1/14/21 10:00 AM, Killian Matter
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Hello ,
<div><br>
</div>
<div>I'm developing a module on asterisk, while debugging i've
come across a problem I don't quite understand.<br>
I'm using a noise filter, at the end of the call I stop my
filter , so clean up everything, detach the audiohook and
there is the problem. It's stuck in the while loop in <b>ast_audiohook_detach</b>.</div>
<div>As far as I understand, to detach audiohook, the status
should not be <b>NEW</b> nor <b>DONE</b>, then it's update
its status to <b>SHUTDOWN</b> which will then put it to <b>DONE</b>,
so why does it get stuck in the while loop and don't update
it's status to <b>DONE</b> ?</div>
<div><br>
</div>
<div>Thank you in advance for your help.</div>
<div>K.M</div>
</div>
<br>
<fieldset></fieldset>
</blockquote>
</div>
-- <br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" rel="noreferrer" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a></blockquote></div>