]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Function init_thread() should return an integer under Windows
[stockfish] / src / search.cpp
index 13f333d9fc5a95511f133ee15f5d0a681e095f16..c692baf5a72e3db774b2e728f25e1c91e93b3b31 100644 (file)
@@ -1440,7 +1440,7 @@ namespace {
     // Loop through all legal moves until no moves remain or a beta cutoff occurs
 
     // Initialize a MovePicker object for the current position
-    MovePicker mp = MovePicker(pos, ttMove, depth, H, &ss[ply]);
+    MovePicker mp = MovePicker(pos, ttMove, depth, H, &ss[ply], beta);
     CheckInfo ci(pos);
 
     while (   bestValue < beta
@@ -2593,7 +2593,7 @@ namespace {
   DWORD WINAPI init_thread(LPVOID threadID) {
 
     TM.idle_loop(*(int*)threadID, NULL);
-    return NULL;
+    return 0;
   }
 
 #endif
@@ -2768,6 +2768,9 @@ namespace {
             cout << "Failed to create thread number " << i << endl;
             Application::exit_with_failure();
         }
+
+        // Wait until the thread has finished launching and is gone to sleep
+        while (threads[i].state != THREAD_SLEEPING);
     }
   }