projects
/
fairystockfish.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
7cb8817
)
Make the debug counters thread safe.
author
Joost VandeVondele
<Joost.VandeVondele@gmail.com>
Fri, 21 Jun 2019 14:24:28 +0000 (16:24 +0200)
committer
Stéphane Nicolet
<Stephane.Nicolet@u-paris2.fr>
Sat, 22 Jun 2019 07:57:07 +0000 (09:57 +0200)
needed to use them in a threaded run.
No functional change.
src/misc.cpp
patch
|
blob
|
history
diff --git
a/src/misc.cpp
b/src/misc.cpp
index
8d3b202
..
b1539ce
100644
(file)
--- 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<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); }