|
|
|
@ -628,14 +628,17 @@ static void *device_state_thread(void *data)
|
|
|
|
|
|
|
|
|
|
|
|
while (!device_state.stop) {
|
|
|
|
while (!device_state.stop) {
|
|
|
|
ast_mutex_lock(&device_state.lock);
|
|
|
|
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);
|
|
|
|
ast_mutex_unlock(&device_state.lock);
|
|
|
|
|
|
|
|
|
|
|
|
/* Check to see if we were woken up to see the request to stop */
|
|
|
|
/* Check to see if we were woken up to see the request to stop */
|
|
|
|
if (device_state.stop)
|
|
|
|
if (device_state.stop)
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!sc)
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
handle_statechange(sc);
|
|
|
|
handle_statechange(sc);
|
|
|
|
|
|
|
|
|
|
|
|
free(sc);
|
|
|
|
free(sc);
|
|
|
|
|