mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
Added /reload command (does not reload source code)
This commit is contained in:
@ -33,12 +33,12 @@ abstract class AsyncTask extends \Threaded{
|
||||
private $result;
|
||||
|
||||
public function run(){
|
||||
$this->synchronized(function(){
|
||||
$this->result = null;
|
||||
$this->onRun(\Thread::getCurrentThread());
|
||||
$this->finished = true;
|
||||
$this->complete = $this->result === null ? true : false;
|
||||
});
|
||||
$this->lock();
|
||||
$this->result = null;
|
||||
$this->onRun();
|
||||
$this->finished = true;
|
||||
$this->complete = $this->result === null ? true : false;
|
||||
$this->unlock();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -82,10 +82,8 @@ abstract class AsyncTask extends \Threaded{
|
||||
/**
|
||||
* Actions to execute when run
|
||||
*
|
||||
* @param \Thread $thread
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public abstract function onRun(\Thread $thread);
|
||||
public abstract function onRun();
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user