]> git.sesse.net Git - stockfish/blobdiff - src/search.h
Some code and comment cleanup
[stockfish] / src / search.h
index c7abb9dcfd97a2b5b47b87f798fc4e5718cd2bb7..6248cd0193310bf4c577f1bfd9d248230c4c326d 100644 (file)
@@ -20,7 +20,8 @@
 #ifndef SEARCH_H_INCLUDED
 #define SEARCH_H_INCLUDED
 
-#include <memory>  // For std::auto_ptr
+#include <atomic>
+#include <memory>  // For std::unique_ptr
 #include <stack>
 #include <vector>
 
@@ -28,8 +29,6 @@
 #include "position.h"
 #include "types.h"
 
-struct SplitPoint;
-
 namespace Search {
 
 /// Stack struct keeps track of the information we need to remember from nodes
@@ -37,7 +36,6 @@ namespace Search {
 /// its own array of Stack objects, indexed by the current ply.
 
 struct Stack {
-  SplitPoint* splitPoint;
   Move* pv;
   int ply;
   Move currentMove;
@@ -91,16 +89,16 @@ struct LimitsType {
   TimePoint startTime;
 };
 
-/// The SignalsType struct stores volatile flags updated during the search
+/// The SignalsType struct stores atomic flags updated during the search
 /// typically in an async fashion e.g. to stop the search by the GUI.
 
 struct SignalsType {
-  bool stop, stopOnPonderhit, firstRootMove, failedLowAtRoot;
+  std::atomic<bool> stop, stopOnPonderhit, firstRootMove, failedLowAtRoot;
 };
 
 typedef std::unique_ptr<std::stack<StateInfo>> StateStackPtr;
 
-extern volatile SignalsType Signals;
+extern SignalsType Signals;
 extern LimitsType Limits;
 extern StateStackPtr SetupStates;