private function waitForAnyThread()
    {
        while (true) {
            foreach ($this->getPIDs() as $pid) {
                if (!$this->isRunning($pid)) {
                    return;
                }
            }

            # If none of the threads have finished let, wait for a second before checking again
            sleep(1);
        }
    }
private function waitForAnyThread()
    {
        while (true) {
            foreach ($this->getPIDs() as $pid) {
                if (!$this->isRunning($pid)) {
                    return;
                }
            }

            # If none of the threads have finished let, wait for a second before checking again
            sleep(1);
        }
    }
private function waitForAnyThread ( ) { while ( true ) { foreach ( $ this -> getPIDs ( ) as $ pid ) { if ( ! $ this -> isRunning ( $ pid ) ) { return ; } } # If none of the threads have finished let, wait for a second before checking again sleep ( 1 ) ; } }
If we've exhausted our limit of threads, wait for one to finish.

@return void
If we ve exhausted our limit of threads wait for one to finish .