Skip to content
Snippets Groups Projects
Commit 3c8dfe09 authored by Mark Spencer's avatar Mark Spencer
Browse files

Fix lock ordering in devicestate

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6069 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent b4f7592e
No related branches found
No related tags found
No related merge requests found
......@@ -184,12 +184,14 @@ int ast_device_state_changed(const char *fmt, ...)
AST_LIST_LOCK(&state_changes);
AST_LIST_INSERT_TAIL(&state_changes, change, list);
if (AST_LIST_FIRST(&state_changes) == change) {
AST_LIST_UNLOCK(&state_changes);
/* the list was empty, signal the thread */
ast_mutex_lock(&change_pending_lock);
pthread_cond_signal(&change_pending);
ast_mutex_unlock(&change_pending_lock);
} else {
AST_LIST_UNLOCK(&state_changes);
}
AST_LIST_UNLOCK(&state_changes);
}
return 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment