From: Krystian Kuzniarek Date: Thu, 31 Dec 2020 16:00:39 +0000 (+0100) Subject: Change lock type X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=329ef2a6aa362f4d831bdde4b31da40f3547985d;p=fairystockfish.git Change lock type No additional features of std::unique_lock has been previously used so it's better to use a lighter lock. closes https://github.com/official-stockfish/Stockfish/pull/3284 No functional change. --- diff --git a/AUTHORS b/AUTHORS index f3ae5f0..d2b2646 100644 --- a/AUTHORS +++ b/AUTHORS @@ -100,6 +100,7 @@ Ken Takusagawa kinderchocolate Kiran Panditrao (Krgp) Kojirion +Krystian Kuzniarek (kuzkry) Leonardo Ljubičić (ICCF World Champion) Leonid Pechenik (lp--) Linus Arver (listx) diff --git a/src/syzygy/tbprobe.cpp b/src/syzygy/tbprobe.cpp index 97d848a..3623478 100644 --- a/src/syzygy/tbprobe.cpp +++ b/src/syzygy/tbprobe.cpp @@ -1141,7 +1141,7 @@ void* mapped(TBTable& e, const Position& pos) { if (e.ready.load(std::memory_order_acquire)) return e.baseAddress; // Could be nullptr if file does not exist - std::unique_lock lk(mutex); + std::scoped_lock lk(mutex); if (e.ready.load(std::memory_order_relaxed)) // Recheck under lock return e.baseAddress;