diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-11-26 18:50:03 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-11-26 18:50:03 +0000 |
commit | 86c5962983c4e1f97eccfa8636ebe5bdc88599cc (patch) | |
tree | aa20f30dc112c0f53efa8a6821f2fd4bc16127b9 /src/controller.c | |
parent | ef3d454616a1b1bae06f035374a64fbde5bbbfff (diff) | |
download | rspamd-86c5962983c4e1f97eccfa8636ebe5bdc88599cc.tar.gz rspamd-86c5962983c4e1f97eccfa8636ebe5bdc88599cc.zip |
Use atomic ops if possible
Diffstat (limited to 'src/controller.c')
-rw-r--r-- | src/controller.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/controller.c b/src/controller.c index bb494108f..d04aba5c7 100644 --- a/src/controller.c +++ b/src/controller.c @@ -1831,7 +1831,12 @@ rspamd_controller_handle_stat_common ( ham += stat->actions_stat[i]; } if (do_reset) { +#ifndef HAVE_ATOMIC_BUILTINS session->ctx->worker->srv->stat->actions_stat[i] = 0; +#else + __atomic_store_n(&session->ctx->worker->srv->stat->actions_stat[i], + 0, __ATOMIC_RELEASE); +#endif } } ucl_object_insert_key (top, sub, "actions", 0, false); |