#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>
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;