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/libutil/logger.h | |
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/libutil/logger.h')
-rw-r--r-- | src/libutil/logger.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libutil/logger.h b/src/libutil/logger.h index 7bf8307c8..2523efad3 100644 --- a/src/libutil/logger.h +++ b/src/libutil/logger.h @@ -124,6 +124,16 @@ void rspamd_log_debug (rspamd_logger_t *logger); void rspamd_log_nodebug (rspamd_logger_t *logger); /** + * Turn off locking on logger (useful to avoid races) + */ +void rspamd_log_nolock (rspamd_logger_t *logger); + +/** + * Turn on locking to avoid log output mix + */ +void rspamd_log_lock (rspamd_logger_t *logger); + +/** * Return array of counters (4 numbers): * 0 - errors * 1 - warnings |