mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 09:06:45 +08:00
Use a timer to avoid polling
The timer will be fired asynchronously to handle time management flags, while other threads are searching. This implementation uses a thread waiting on a timed condition variable instead of real timers. This approach allow to reduce platform dependant code to a minimum and also is the most portable given that timers libraries are very different among platforms and also the best ones are not compatible with olds Windows. Also retire the now unused polling code. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -22,12 +22,15 @@
|
||||
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
|
||||
#include "lock.h"
|
||||
#include "types.h"
|
||||
|
||||
extern const std::string engine_name();
|
||||
extern const std::string engine_authors();
|
||||
extern int get_system_time();
|
||||
extern int cpu_count();
|
||||
extern void timed_wait(WaitCondition*, Lock*, int);
|
||||
extern void prefetch(char* addr);
|
||||
|
||||
extern void dbg_hit_on(bool b);
|
||||
|
||||
Reference in New Issue
Block a user