// Try to allocate available threads and ask them to start searching setting
// 'searching' flag. This must be done under lock protection to avoid concurrent
// allocation of the same slave by another master.
- Threads.mutex.lock();
- sp.mutex.lock();
+ Threads.spinlock.acquire();
+ sp.spinlock.acquire();
sp.allSlavesSearching = true; // Must be set under lock protection
++splitPointsSize;
// it will instantly launch a search, because its 'searching' flag is set.
// The thread will return from the idle loop when all slaves have finished
// their work at this split point.
- sp.mutex.unlock();
- Threads.mutex.unlock();
+ sp.spinlock.release();
+ Threads.spinlock.release();
Thread::idle_loop(); // Force a call to base class idle_loop()
// We have returned from the idle loop, which means that all threads are
// finished. Note that setting 'searching' and decreasing splitPointsSize must
// be done under lock protection to avoid a race with Thread::available_to().
- Threads.mutex.lock();
- sp.mutex.lock();
+ Threads.spinlock.acquire();
+ sp.spinlock.acquire();
searching = true;
--splitPointsSize;
*bestMove = sp.bestMove;
*bestValue = sp.bestValue;
- sp.mutex.unlock();
- Threads.mutex.unlock();
+ sp.spinlock.release();
+ Threads.spinlock.release();
}