X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fthread.h;h=4d70bf2fbd038a9da98971c04c1bada7ba523743;hb=13c11f40480ec97316bd4da3a53787cc871037ea;hp=0469dc1d70fa180cfe17ca6a38e1c7a733b1ba28;hpb=04372316b3739e4e99ab1bcfd6923fef9de3110f;p=stockfish diff --git a/src/thread.h b/src/thread.h index 0469dc1d..4d70bf2f 100644 --- a/src/thread.h +++ b/src/thread.h @@ -41,18 +41,6 @@ const size_t MAX_SPLITPOINTS_PER_THREAD = 8; const size_t MAX_SLAVES_PER_SPLITPOINT = 4; -/// Spinlock class wraps low level atomic operations to provide a spin lock - -class Spinlock { - - Mutex m; // WARNING: Diasabled spinlocks to test on fishtest - -public: - void acquire() { m.lock(); } - void release() { m.unlock(); } -}; - - /// SplitPoint struct stores information shared by the threads searching in /// parallel below the same split point. It is populated at splitting time. @@ -72,7 +60,7 @@ struct SplitPoint { SplitPoint* parentSplitPoint; // Shared variable data - Spinlock spinlock; + Mutex mutex; std::bitset slavesMask; volatile bool allSlavesSearching; volatile uint64_t nodes; @@ -163,7 +151,6 @@ struct ThreadPool : public std::vector { void start_thinking(const Position&, const Search::LimitsType&, Search::StateStackPtr&); Depth minimumSplitDepth; - Spinlock spinlock; ConditionVariable sleepCondition; TimerThread* timer; };