Reformat threads code

Apart from some renaming the biggest change
is the retire of split_point_finished()
replaced by slavesMask flags. As a side
effect we now take also split point lock
when allocation available threads.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2012-01-26 23:18:43 +01:00
parent a189a5f0c5
commit 7fb6fd2f55
3 changed files with 72 additions and 95 deletions

View File

@@ -50,12 +50,12 @@ struct SplitPoint {
// Shared data
Lock lock;
volatile uint64_t slavesMask;
volatile int64_t nodes;
volatile Value alpha;
volatile Value bestValue;
volatile int moveCount;
volatile bool is_betaCutoff;
volatile bool is_slave[MAX_THREADS];
};
@@ -69,7 +69,7 @@ struct Thread {
void wake_up();
bool cutoff_occurred() const;
bool is_available_to(int master) const;
void idle_loop(SplitPoint* sp);
void idle_loop(SplitPoint* sp_master);
void main_loop();
void timer_loop();
@@ -85,7 +85,7 @@ struct Thread {
volatile int activeSplitPoints;
volatile bool is_searching;
volatile bool do_sleep;
volatile bool do_terminate;
volatile bool do_exit;
};
@@ -110,7 +110,6 @@ public:
void set_size(int cnt);
void read_uci_options();
bool available_slave_exists(int master) const;
bool split_point_finished(SplitPoint* sp) const;
void set_timer(int msec);
void wait_for_stop_or_ponderhit();
void stop_thinking();