mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-22 18:17:02 +08:00
Simplify locking in sp_search and sp_search_pv
Avoid to take the lock two times in a tight sequence, the first in get_next_move() and the second to update sp->moves. Do all with one lock and so retire the now useless locked version of get_next_move(). Also fix some theorical race due to comparison sp->bestValue < sp->beta is done out of lock protection. Finally fix another (harmless but time waster) race that coudl occur because thread_should_stop() is also called outside of lock protection. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -27,7 +27,6 @@
|
||||
|
||||
#include "depth.h"
|
||||
#include "history.h"
|
||||
#include "lock.h"
|
||||
#include "position.h"
|
||||
|
||||
|
||||
@@ -52,7 +51,6 @@ class MovePicker {
|
||||
public:
|
||||
MovePicker(const Position& p, Move ttm, Depth d, const History& h, SearchStack* ss = NULL);
|
||||
Move get_next_move();
|
||||
Move get_next_move(Lock& lock);
|
||||
int number_of_evasions() const;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user