<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<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 class="moz-signature" cols="72">Dennis Buteyn
Xorcom Ltd</pre>
<div class="moz-cite-prefix">On 1/14/21 10:00 AM, Killian Matter
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAG0PF9t1d2PtZ14FEhvpkzwK5wSG8EOVm_nX19Y7vu0C4jmN5Q@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<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 class="mimeAttachmentHeader"></fieldset>
</blockquote>
</body>
</html>