From: Russell Bryant Date: Tue, 3 Jul 2007 18:25:30 +0000 (+0000) Subject: Fix up the device state processing thread in app_queue so that it's not X-Git-Tag: 1.6.0-beta1~3^2~2164 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a53d595a5113f70b677bba1abed6106103b7492;p=thirdparty%2Fasterisk.git Fix up the device state processing thread in app_queue so that it's not possible for there to be entries in the queue and the thread is just sleeping (Thanks to mmichelson for bringing the problem to my attention) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@73127 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_queue.c b/apps/app_queue.c index 85f1b6efec..425f3c64a1 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -631,8 +631,10 @@ static void *device_state_thread(void *data) while (!device_state.stop) { ast_mutex_lock(&device_state.lock); - ast_cond_wait(&device_state.cond, &device_state.lock); - sc = AST_LIST_REMOVE_HEAD(&device_state.state_change_q, entry); + if (!(sc = AST_LIST_REMOVE_HEAD(&device_state.state_change_q, entry))) { + ast_cond_wait(&device_state.cond, &device_state.lock); + sc = AST_LIST_REMOVE_HEAD(&device_state.state_change_q, entry); + } ast_mutex_unlock(&device_state.lock); /* Check to see if we were woken up to see the request to stop */