mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
Improved threading and resource usage, new defaults
This commit is contained in:
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user