]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 30033 via svnmerge from
authorJoshua Colp <jcolp@digium.com>
Wed, 24 May 2006 19:16:07 +0000 (19:16 +0000)
committerJoshua Colp <jcolp@digium.com>
Wed, 24 May 2006 19:16:07 +0000 (19:16 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r30033 | file | 2006-05-24 16:14:01 -0300 (Wed, 24 May 2006) | 2 lines

Fix deadlock caused by a race condition in the logger when reloading (issue #7195 reported and fixed by softins)

........

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

logger.c

index 522a96b2d88e89e6c1bf17acd1f87e27585d2b91..e4673a7182da4aaa88e7a701adc4205b45a7431a 100644 (file)
--- a/logger.c
+++ b/logger.c
@@ -385,6 +385,7 @@ int reload_logger(int rotate)
        FILE *myf;
        int x, res = 0;
 
+       ast_mutex_lock(&msglist_lock);  /* to avoid deadlock */
        ast_mutex_lock(&loglock);
        if (eventlog) 
                fclose(eventlog);
@@ -491,6 +492,7 @@ int reload_logger(int rotate)
                }
        }
        ast_mutex_unlock(&loglock);
+       ast_mutex_unlock(&msglist_lock);
 
        return res;
 }