Issue 1843 - RCON worker threads synchronization corrected

This commit is contained in:
Milosz Danielewski
2014-08-07 10:19:23 +02:00
parent 269a10fadd
commit 5242e87026
2 changed files with 12 additions and 4 deletions

View File

@ -85,11 +85,15 @@ class RCON{
}elseif($this->workers[$n]->isWaiting()){
if($this->workers[$n]->response !== ""){
MainLogger::getLogger()->info($this->workers[$n]->response);
$this->workers[$n]->notify();
$this->workers[$n]->synchronized(function($thread){
$thread->notify();
}, $this->workers[$n]);
}else{
Server::getInstance()->dispatchCommand($response = new RemoteConsoleCommandSender(), $this->workers[$n]->cmd);
$this->workers[$n]->response = TextFormat::clean($response->getMessage());
$this->workers[$n]->notify();
$this->workers[$n]->synchronized(function($thread){
$thread->notify();
}, $this->workers[$n]);
}
}
}