Updated to new pthreads version, updated RakLib

This commit is contained in:
Shoghi Cervantes
2015-09-27 13:37:27 +02:00
parent 0bcf639a98
commit ddc140af5e
10 changed files with 33 additions and 26 deletions

View File

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