Fix #1540 : Unable to start scheduler on Windows platform

This commit is contained in:
Romain Neutron
2013-10-17 13:55:58 +02:00
parent cc75ef5ac6
commit f1db13cede

View File

@@ -362,7 +362,14 @@ class task_Scheduler
);
if (is_resource($taskPoll[$tkey]["process"])) {
sleep(2); // let the process lock and write it's pid
// let the process lock and write it's pid
$sleepTimeout = microtime(true) + 10;
do {
usleep(500000);
if (null !== $taskPoll[$tkey]['task']->getPID()) {
break;
}
} while (microtime(true) < $sleepTimeout);
}
if (is_resource($taskPoll[$tkey]["process"]) && ($pid = $taskPoll[$tkey]['task']->getPID()) !== null) {