Merged revisions 44921 via svnmerge from
authorNadi Sarrar <ns@beronet.com>
Thu, 12 Oct 2006 13:04:03 +0000 (13:04 +0000)
committerNadi Sarrar <ns@beronet.com>
Thu, 12 Oct 2006 13:04:03 +0000 (13:04 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r44921 | nadi | 2006-10-12 14:55:25 +0200 (Do, 12 Okt 2006) | 2 lines

append_event must be called while holding the session lock

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@44922 65c4cc65-6c06-0410-ace0-fbb531ad65f3

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");     
        
-       append_event(buf->str, category);
-       
        /* 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)