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.
kinderchocolate
Kiran Panditrao (Krgp)
Kojirion
+Krystian Kuzniarek (kuzkry)
Leonardo Ljubičić (ICCF World Champion)
Leonid Pechenik (lp--)
Linus Arver (listx)
if (e.ready.load(std::memory_order_acquire))
return e.baseAddress; // Could be nullptr if file does not exist
- std::unique_lock<std::mutex> lk(mutex);
+ std::scoped_lock<std::mutex> lk(mutex);
if (e.ready.load(std::memory_order_relaxed)) // Recheck under lock
return e.baseAddress;