That loop is equivalent to:

audiohook->status = AST_AUDIOHOOK_STATUS_SHUTDOWN;
while (audiohook->status != AST_AUDIOHOOK_STATUS_DONE) {
    sleep(...);
}

Something else (in another thread) must change the status in order for that loop to terminate.

Side note: that struct member probably should be marked volatile, I can imagine very eager compilers assuming that status never changes and optimizing that code into a real infinite loop.

Dennis Buteyn
Xorcom Ltd

On 1/14/21 10:00 AM, Killian Matter wrote:
Hello ,

I'm developing a module on asterisk, while debugging i've come across a problem I don't quite understand. 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 *ast_audiohook_detach*. As far as I understand, to detach audiohook, the status should not be *NEW* nor *DONE*, then it's update its status to *SHUTDOWN* which will then put it to *DONE*, so why does it get stuck in the while loop and don't update it's status to *DONE* ?

Thank you in advance for your help.
K.M

-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev

Reply via email to