mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Updated to new pthreads version, updated RakLib
This commit is contained in:
@ -28,6 +28,8 @@ abstract class Worker extends \Worker{
|
||||
|
||||
/** @var \ClassLoader */
|
||||
protected $classLoader;
|
||||
|
||||
protected $isKilled = false;
|
||||
|
||||
public function getClassLoader(){
|
||||
return $this->classLoader;
|
||||
@ -68,17 +70,18 @@ abstract class Worker extends \Worker{
|
||||
* Stops the thread using the best way possible. Try to stop it yourself before calling this.
|
||||
*/
|
||||
public function quit(){
|
||||
$this->isKilled = true;
|
||||
|
||||
$this->notify();
|
||||
|
||||
if($this->isRunning()){
|
||||
$this->shutdown();
|
||||
$this->notify();
|
||||
$this->unstack();
|
||||
$this->kill();
|
||||
}elseif(!$this->isJoined()){
|
||||
if(!$this->isTerminated()){
|
||||
$this->join();
|
||||
}else{
|
||||
$this->kill();
|
||||
}
|
||||
}else{
|
||||
$this->kill();
|
||||
}
|
||||
|
||||
ThreadManager::getInstance()->remove($this);
|
||||
@ -87,4 +90,4 @@ abstract class Worker extends \Worker{
|
||||
public function getThreadName(){
|
||||
return (new \ReflectionClass($this))->getShortName();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user