Skip to content

Commit e2be414

Browse files
vondelemstembera
authored andcommitted
Make the debug counters thread safe.
needed to use them in a threaded run. No functional change.
1 parent 5ad2663 commit e2be414

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/misc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ const string engine_info(bool to_uci) {
145145

146146

147147
/// Debug functions used mainly to collect run-time statistics
148-
static int64_t hits[2], means[2];
148+
static std::atomic<int64_t> hits[2], means[2];
149149

150150
void dbg_hit_on(bool b) { ++hits[0]; if (b) ++hits[1]; }
151151
void dbg_hit_on(bool c, bool b) { if (c) dbg_hit_on(b); }

0 commit comments

Comments
 (0)