Added /reload command (does not reload source code)

This commit is contained in:
Shoghi Cervantes
2014-04-03 15:49:00 +02:00
parent ee6dc989ce
commit 80f9093875
12 changed files with 210 additions and 70 deletions

View File

@ -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();
}