Merged revisions 44921 via svnmerge from
[asterisk/asterisk.git] / main / manager.c
index 31164e3..b2b546b 100644 (file)
@@ -2234,10 +2234,9 @@ int manager_event(int category, const char *event, const char *fmt, ...)
        
        ast_dynamic_str_thread_append(&buf, 0, &manager_event_buf, "\r\n");     
        
        
        ast_dynamic_str_thread_append(&buf, 0, &manager_event_buf, "\r\n");     
        
-       append_event(buf->str, category);
-       
        /* Append even to master list and wake up any sleeping sessions */
        AST_LIST_LOCK(&sessions);
        /* Append even to master list and wake up any sleeping sessions */
        AST_LIST_LOCK(&sessions);
+       append_event(buf->str, category);
        AST_LIST_TRAVERSE(&sessions, s, list) {
                ast_mutex_lock(&s->__lock);
                if (s->waiting_thread != AST_PTHREADT_NULL)
        AST_LIST_TRAVERSE(&sessions, s, list) {
                ast_mutex_lock(&s->__lock);
                if (s->waiting_thread != AST_PTHREADT_NULL)