Skip to content

Commit

Permalink
Make the debug counters thread safe.
Browse files Browse the repository at this point in the history
needed to use them in a threaded run.

No functional change.
  • Loading branch information
vondele authored and mstembera committed Aug 29, 2019
1 parent 5d0de60 commit 61f111b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int64_t> 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); }
Expand Down

0 comments on commit 61f111b

Please sign in to comment.