Improved threading and resource usage, new defaults

This commit is contained in:
Shoghi Cervantes
2015-01-02 18:46:39 +01:00
parent 47cbf56725
commit 692045d714
10 changed files with 163 additions and 68 deletions

View File

@ -26,9 +26,13 @@ namespace pocketmine;
*/
abstract class Worker extends \Worker{
public final function start($options = PTHREADS_INHERIT_ALL){
public function start($options = PTHREADS_INHERIT_ALL){
ThreadManager::getInstance()->add($this);
return parent::start($options);
if(!$this->isRunning() and !$this->isJoined() and !$this->isTerminated() and !$this->isShutdown()){
return parent::start($options);
}
return false;
}
}