]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix deadlock caused by a race condition in the logger when reloading (issue #7195...
authorJoshua Colp <jcolp@digium.com>
Wed, 24 May 2006 19:14:01 +0000 (19:14 +0000)
committerJoshua Colp <jcolp@digium.com>
Wed, 24 May 2006 19:14:01 +0000 (19:14 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@30033 65c4cc65-6c06-0410-ace0-fbb531ad65f3

logger.c

index 0a397ff46bc8e49c78d4a030343d4694f58e0dd5..0cb0f06d0576122004745bbcaae10b810fb6c97a 100644 (file)
--- a/logger.c
+++ b/logger.c
@@ -384,6 +384,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);
@@ -490,6 +491,7 @@ int reload_logger(int rotate)
                }
        }
        ast_mutex_unlock(&loglock);
+       ast_mutex_unlock(&msglist_lock);
 
        return res;
 }