aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-24 19:14:01 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-24 19:14:01 +0000
commit28f103ab4627c9fab8f834136aa9269f8b4e08f9 (patch)
tree144c128bf0d34459a0463ae2105b0289a96a4cd2
parent709401939a46e3a9e7b5fdabedd3bab169f71947 (diff)
Fix deadlock caused by a race condition in the logger when reloading (issue #7195 reported and fixed by softins)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@30033 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--logger.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/logger.c b/logger.c
index 0a397ff46..0cb0f06d0 100644
--- 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;
}