diff --git a/logger.c b/logger.c index 522a96b2d8..e4673a7182 100644 --- 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; }