]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Bug 7004 - release all threads waiting on a condition prior to freeing it
authorTilghman Lesher <tilghman@meg.abyt.es>
Fri, 21 Apr 2006 22:12:26 +0000 (22:12 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Fri, 21 Apr 2006 22:12:26 +0000 (22:12 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@22112 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channel.c

index ae4c747e4e1bc9c4f29f5930e443a507e7f43eff..5f73bb14e96674c2814f4e0571117969c1538f0e 100644 (file)
--- a/channel.c
+++ b/channel.c
@@ -1057,6 +1057,9 @@ void ast_channel_spy_remove(struct ast_channel *chan, struct ast_channel_spy *sp
                ast_frfree(f);
        }
 
+       /* Release all threads waiting on this trigger prior to destroying it */
+       ast_cond_broadcast(&spy->trigger);
+
        if (ast_test_flag(spy, CHANSPY_TRIGGER_MODE) != CHANSPY_TRIGGER_NONE)
                ast_cond_destroy(&spy->trigger);
 
@@ -1088,7 +1091,7 @@ static void detach_spies(struct ast_channel *chan)
                if (spy->status == CHANSPY_RUNNING)
                        spy->status = CHANSPY_DONE;
                if (ast_test_flag(spy, CHANSPY_TRIGGER_MODE) != CHANSPY_TRIGGER_NONE)
-                       ast_cond_signal(&spy->trigger);
+                       ast_cond_broadcast(&spy->trigger);
                ast_mutex_unlock(&spy->lock);
        }