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,7 @@ abstract class Thread extends \Thread{
/** @var \ClassLoader */
protected $classLoader;
protected $isKilled = false;
public function getClassLoader(){
return $this->classLoader;
@ -68,16 +69,14 @@ abstract class Thread extends \Thread{
* Stops the thread using the best way possible. Try to stop it yourself before calling this.
*/
public function quit(){
if($this->isRunning()){
$this->kill();
}elseif(!$this->isJoined()){
$this->isKilled = true;
$this->notify();
if(!$this->isJoined()){
if(!$this->isTerminated()){
$this->join();
}else{
$this->kill();
}
}else{
$this->kill();
}
ThreadManager::getInstance()->remove($this);
@ -86,4 +85,4 @@ abstract class Thread extends \Thread{
public function getThreadName(){
return (new \ReflectionClass($this))->getShortName();
}
}
}