mirror of
https://github.com/sockspls/badfish
synced 2025-07-11 19:49:14 +00:00
Teach UI thread to use main thread resources
So to avoid a crash when setting the moves in UCI "position startpos moves ...." command. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
e1919384a2
commit
5a2d525048
1 changed files with 2 additions and 1 deletions
|
@ -210,6 +210,7 @@ void ThreadsManager::init() {
|
|||
lock_init(splitLock);
|
||||
timer = new Thread(&Thread::timer_loop);
|
||||
threads.push_back(new Thread(&Thread::main_loop));
|
||||
set_this_thread(main_thread()); // Use main thread's resources
|
||||
read_uci_options();
|
||||
}
|
||||
|
||||
|
@ -313,7 +314,7 @@ Value ThreadsManager::split(Position& pos, Stack* ss, Value alpha, Value beta,
|
|||
assert(beta <= VALUE_INFINITE);
|
||||
assert(depth > DEPTH_ZERO);
|
||||
|
||||
Thread* master = Threads.this_thread();
|
||||
Thread* master = this_thread();
|
||||
|
||||
if (master->splitPointsCnt >= MAX_SPLITPOINTS_PER_THREAD)
|
||||
return bestValue;
|
||||
|
|
Loading…
Add table
Reference in a new issue