diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-29 15:18:39 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-29 15:18:39 +0000 |
commit | 2cbece2248e8a90b7a71319ae59b638b36ced6df (patch) | |
tree | 476da92d29a0bd275628dc02ee3e50e79710c3d7 /src/rspamd.c | |
parent | 40c93053ef5687ad722203c05ab7017711e482a1 (diff) | |
download | rspamd-2cbece2248e8a90b7a71319ae59b638b36ced6df.tar.gz rspamd-2cbece2248e8a90b7a71319ae59b638b36ced6df.zip |
[Feature] Add lockless logging
Sometimes, it is needed to turn off logging mutex to avoid recursive
mutex obtaining. It is especially useful to do it within children wait
code in the main processes dispatcher.
Diffstat (limited to 'src/rspamd.c')
-rw-r--r-- | src/rspamd.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/rspamd.c b/src/rspamd.c index 8ff95cd7a..cada080b9 100644 --- a/src/rspamd.c +++ b/src/rspamd.c @@ -821,6 +821,9 @@ rspamd_cld_handler (gint signo, short what, gpointer arg) struct rspamd_worker *cur; pid_t wrk; + /* Turn off locking for logger */ + rspamd_log_nolock (rspamd_main->logger); + msg_debug_main ("catch SIGCHLD signal, finding terminated worker"); /* Remove dead child form children list */ wrk = waitpid (0, &res, 0); @@ -891,6 +894,8 @@ rspamd_cld_handler (gint signo, short what, gpointer arg) } } } + + rspamd_log_lock (rspamd_main->logger); } static void |