All pastes #950450 Raw Edit

Miscellany

public text v1 · immutable
·published 2008-03-20 16:23 UTC
rendered paste body
Index: main/autoservice.c
===================================================================
--- main/autoservice.c  (revision 110165)
+++ main/autoservice.c  (working copy)
@@ -254,9 +254,6 @@
        }
        AST_LIST_TRAVERSE_SAFE_END;
 
-       if (removed && asthread != AST_PTHREADT_NULL) 
-               pthread_kill(asthread, SIGURG);
-
        AST_LIST_UNLOCK(&aslist);
 
        if (!removed)
@@ -265,6 +262,9 @@
        if (!orig_end_dtmf_flag)
                ast_clear_flag(chan, AST_FLAG_END_DTMF_ONLY);
 
+       if (ast_test_flag(chan, AST_FLAG_BLOCKING) && asthread != AST_PTHREADT_NULL)
+               pthread_kill(asthread, SIGURG);
+
        /* Wait for it to un-block */
        while (ast_test_flag(chan, AST_FLAG_BLOCKING))
                usleep(1000);
@@ -274,6 +274,9 @@
                ast_frfree(f);
        }
 
+       if (chan_list_state == as_chan_list_state && asthread != AST_PTHREADT_NULL)
+               pthread_kill(asthread, SIGURG);
+
        while (chan_list_state == as_chan_list_state)
                usleep(1000);