mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 00:33:09 +00:00
Re-add the hack
This reverts commit 869c924410
I misunderstood here. Actually it can happen that
thread is created but still not entered idle_loop
and at the same time start_searching() is called.
Becuase 'do_sleep' is set start_searching() will
set it to false and start the search, but when,
at last, the thread enters idle_loop(), resets
the flag and goes to sleep: not what we want.
Revert the hack waiting for a better solution
in the next patches.
No functional change.
This commit is contained in:
parent
dda7de17e7
commit
99ae47716a
1 changed files with 2 additions and 1 deletions
|
@ -49,7 +49,8 @@ Thread::Thread(Fn fn) : splitPoints() {
|
|||
curSplitPoint = NULL;
|
||||
start_fn = fn;
|
||||
idx = Threads.size();
|
||||
do_sleep = true;
|
||||
|
||||
do_sleep = (fn != &Thread::main_loop); // Avoid a race with start_searching()
|
||||
|
||||
if (!thread_create(handle, start_routine, this))
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue