Skip to content

Commit 29babbb

Browse files
committed
stockfish.js: Cannot use threads in TT.clear()
1 parent ad58942 commit 29babbb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/tt.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ void TranspositionTable::resize(size_t mbSize) {
8080

8181
void TranspositionTable::clear() {
8282

83+
#ifndef __EMSCRIPTEN__
8384
std::vector<std::thread> threads;
8485

8586
for (size_t idx = 0; idx < Options["Threads"]; idx++)
@@ -102,6 +103,9 @@ void TranspositionTable::clear() {
102103

103104
for (std::thread& th: threads)
104105
th.join();
106+
#else
107+
std::memset(table, 0, clusterCount * sizeof(Cluster));
108+
#endif // #ifndef __EMSCRIPTEN__
105109
}
106110

107111
/// TranspositionTable::probe() looks up the current position in the transposition

0 commit comments

Comments
 (0)