idle() public method

Runs the idle function, this will call either sleep or usleep depending upon the type.
public idle ( Processor $processor ) : void
$processor XPSPL\Processor
return void
Example #1
0
 /**
  * Run the idle function.
  */
 public function idle(Processor $processor)
 {
     foreach ($processor->active_threads as $_key => $_thread) {
         // Add better checks
         $_thread[1]->join();
         if ($_thread[1]->isRunning() === false) {
             unset($processor->active_threads[$_key]);
         }
     }
     parent::idle($processor);
 }