diff options
-rw-r--r-- | channels/chan_iax2.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index b000561c3..eb7383db3 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -10155,15 +10155,14 @@ static void *sched_thread(void *ignore) struct timespec ts; for (;;) { + pthread_testcancel(); + ast_mutex_lock(&sched_lock); res = ast_sched_wait(sched); if ((res > 1000) || (res < 0)) res = 1000; wait = ast_tvadd(ast_tvnow(), ast_samp2tv(res, 1000)); ts.tv_sec = wait.tv_sec; ts.tv_nsec = wait.tv_usec * 1000; - - pthread_testcancel(); - ast_mutex_lock(&sched_lock); ast_cond_timedwait(&sched_cond, &sched_lock, &ts); ast_mutex_unlock(&sched_lock); pthread_testcancel(); |