public function removeTerminated()
    {
        // @TODO: remove
        $n = 0;
        foreach ($this->threads as $id => $thread) {
            if (!$thread->getPid() || !$thread->ifExists()) {
                $thread->setTerminated();
                unset($this->threads[$id]);
                continue;
            }
            ++$n;
        }
        return $n;
    }
public function removeTerminated()
    {
        // @TODO: remove
        $n = 0;
        foreach ($this->threads as $id => $thread) {
            if (!$thread->getPid() || !$thread->ifExists()) {
                $thread->setTerminated();
                unset($this->threads[$id]);
                continue;
            }
            ++$n;
        }
        return $n;
    }
public function removeTerminated ( ) { // @TODO: remove $ n = 0 ; foreach ( $ this -> threads as $ id => $ thread ) { if ( ! $ thread -> getPid ( ) || ! $ thread -> ifExists ( ) ) { $ thread -> setTerminated ( ) ; unset ( $ this -> threads [ $ id ] ) ; continue ; } ++ $ n ; } return $ n ; }
Remove terminated threads from the collection
@return integer Rest threads count
Remove terminated threads from the collection