]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Use atomic
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 17 May 2018 13:45:22 +0000 (14:45 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 17 May 2018 13:45:22 +0000 (14:45 +0100)
src/libserver/symbols_cache.c

index d44b585e9d0084c48421e842afd63c5a5847af09..eac6c8d0cbe41e3008dcfba53b19719a11e2c699 100644 (file)
@@ -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 */