1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 16:53:09 +00:00

Rename MaxActiveSplitPoints

And move in thread.h togheter with THREAD_MAX

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2010-01-03 15:35:12 +01:00
parent c8af7a867e
commit 9e6d38d224
2 changed files with 5 additions and 5 deletions

View file

@ -246,8 +246,7 @@ namespace {
Lock MPLock; Lock MPLock;
Lock IOLock; Lock IOLock;
bool AllThreadsShouldExit = false; bool AllThreadsShouldExit = false;
const int MaxActiveSplitPoints = 8; // FIXME, sync with UCI Option SplitPoint SplitPointStack[THREAD_MAX][ACTIVE_SPLIT_POINTS_MAX];
SplitPoint SplitPointStack[THREAD_MAX][MaxActiveSplitPoints];
bool Idle = true; bool Idle = true;
#if !defined(_MSC_VER) #if !defined(_MSC_VER)
@ -2781,7 +2780,7 @@ namespace {
void init_split_point_stack() { void init_split_point_stack() {
for(int i = 0; i < THREAD_MAX; i++) for(int i = 0; i < THREAD_MAX; i++)
for(int j = 0; j < MaxActiveSplitPoints; j++) { for(int j = 0; j < ACTIVE_SPLIT_POINTS_MAX; j++) {
SplitPointStack[i][j].parent = NULL; SplitPointStack[i][j].parent = NULL;
lock_init(&(SplitPointStack[i][j].lock), NULL); lock_init(&(SplitPointStack[i][j].lock), NULL);
} }
@ -2793,7 +2792,7 @@ namespace {
void destroy_split_point_stack() { void destroy_split_point_stack() {
for(int i = 0; i < THREAD_MAX; i++) for(int i = 0; i < THREAD_MAX; i++)
for(int j = 0; j < MaxActiveSplitPoints; j++) for(int j = 0; j < ACTIVE_SPLIT_POINTS_MAX; j++)
lock_destroy(&(SplitPointStack[i][j].lock)); lock_destroy(&(SplitPointStack[i][j].lock));
} }
@ -2901,7 +2900,7 @@ namespace {
// If no other thread is available to help us, or if we have too many // If no other thread is available to help us, or if we have too many
// active split points, don't split. // active split points, don't split.
if(!idle_thread_exists(master) || if(!idle_thread_exists(master) ||
Threads[master].activeSplitPoints >= MaxActiveSplitPoints) { Threads[master].activeSplitPoints >= ACTIVE_SPLIT_POINTS_MAX) {
lock_release(&MPLock); lock_release(&MPLock);
return false; return false;
} }

View file

@ -37,6 +37,7 @@
//// ////
const int THREAD_MAX = 8; const int THREAD_MAX = 8;
const int ACTIVE_SPLIT_POINTS_MAX = 8;
//// ////