summaryrefslogtreecommitdiff
path: root/apps/app_queue.c
diff options
context:
space:
mode:
authorBrett Bryant <bbryant@digium.com>2007-06-18 22:23:51 +0000
committerBrett Bryant <bbryant@digium.com>2007-06-18 22:23:51 +0000
commit7573042f954910b92fc3a2c033a72d580c8f02a2 (patch)
tree9dd7a09290dc3b7cbed1e5b8613cb31d603886aa /apps/app_queue.c
parent4cca0a6a8e476c305e35d551cb0227c7632953ee (diff)
Fixed issue where 'stop gracfeully' was hanging ...
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69807 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r--apps/app_queue.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index fb919f107..06e9a913c 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -628,14 +628,17 @@ static void *device_state_thread(void *data)
while (!device_state.stop) {
ast_mutex_lock(&device_state.lock);
- while (!(sc = AST_LIST_REMOVE_HEAD(&device_state.state_change_q, entry)))
- ast_cond_wait(&device_state.cond, &device_state.lock);
+ 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 */
if (device_state.stop)
return NULL;
+ if (!sc)
+ continue;
+
handle_statechange(sc);
free(sc);