From: Vsevolod Stakhov Date: Thu, 17 May 2018 13:45:22 +0000 (+0100) Subject: [Minor] Use atomic X-Git-Tag: 1.7.5~6 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=bacfb3a57b70a7c366672136178f8b84c21929c6;p=rspamd.git [Minor] Use atomic --- diff --git a/src/libserver/symbols_cache.c b/src/libserver/symbols_cache.c index d44b585e9..eac6c8d0c 100644 --- a/src/libserver/symbols_cache.c +++ b/src/libserver/symbols_cache.c @@ -2088,7 +2088,7 @@ rspamd_symbols_cache_resort_cb (gint fd, short what, gpointer ud) for (i = 0; i < cache->items_by_id->len; i ++) { item = g_ptr_array_index (cache->items_by_id, i); item->st->total_hits += item->st->hits; - item->st->hits = 0; + g_atomic_int_set (&item->st->hits, 0); if (item->last_count > 0 && cbdata->w->index == 0) { /* Calculate frequency */