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/libserver/protocol.c | |
parent | ef3d454616a1b1bae06f035374a64fbde5bbbfff (diff) | |
download | rspamd-86c5962983c4e1f97eccfa8636ebe5bdc88599cc.tar.gz rspamd-86c5962983c4e1f97eccfa8636ebe5bdc88599cc.zip |
Use atomic ops if possible
Diffstat (limited to 'src/libserver/protocol.c')
-rw-r--r-- | src/libserver/protocol.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c index d20c50ff8..5cd3589f6 100644 --- a/src/libserver/protocol.c +++ b/src/libserver/protocol.c @@ -1035,13 +1035,22 @@ rspamd_protocol_http_reply (struct rspamd_http_message *msg, action = rspamd_check_action_metric (task, metric_res->score, &required_score, metric_res->metric); if (action <= METRIC_ACTION_NOACTION) { +#ifndef HAVE_ATOMIC_BUILTINS task->worker->srv->stat->actions_stat[action]++; +#else + __atomic_add_fetch (&task->worker->srv->stat->actions_stat[action], + 1, __ATOMIC_RELEASE); +#endif } } /* Increase counters */ - +#ifndef HAVE_ATOMIC_BUILTINS task->worker->srv->stat->messages_scanned++; +#else + __atomic_add_fetch (&task->worker->srv->stat->messages_scanned, + 1, __ATOMIC_RELEASE); +#endif } } |