From 4c986b050111e4fb96716a75ae2168c005b03df9 Mon Sep 17 00:00:00 2001 From: Joost VandeVondele Date: Fri, 21 Jun 2019 16:24:28 +0200 Subject: [PATCH] Make the debug counters thread safe. needed to use them in a threaded run. No functional change. --- src/misc.cpp | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/misc.cpp b/src/misc.cpp index 8d3b202..b1539ce 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -145,7 +145,7 @@ const string engine_info(bool to_uci) { /// Debug functions used mainly to collect run-time statistics -static int64_t hits[2], means[2]; +static std::atomic hits[2], means[2]; void dbg_hit_on(bool b) { ++hits[0]; if (b) ++hits[1]; } void dbg_hit_on(bool c, bool b) { if (c) dbg_hit_on(b); } -- 1.7.0.4