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

@ -30,23 +30,25 @@ use pocketmine\Server;
*/
abstract class AsyncTask extends \Collectable{
private $finished = null;
private $result = null;
/** @var int */
private $taskId = null;
public function run(){
$this->finished = false;
$this->result = null;
$this->onRun();
$this->finished = true;
$this->setGarbage();
}
/**
* @deprecated
*
* @return bool
*/
public function isFinished(){
return $this->finished === true;
return $this->isGarbage();
}
/**