AsyncWorker IDs now start from 0 instead of 1

this now matches their IDs in the AsyncWorker pool, as used by submitTask().
This commit is contained in:
Dylan K. Taylor 2018-06-11 11:58:07 +01:00
parent 8704d378d4
commit 3be6665e3d
2 changed files with 2 additions and 2 deletions

View File

@ -139,7 +139,7 @@ class PopulationTask extends AsyncTask{
$level = $server->getLevel($this->levelId);
if($level !== null){
if(!$this->state){
$level->registerGeneratorToWorker($this->worker->getAsyncWorkerId() - 1);
$level->registerGeneratorToWorker($this->worker->getAsyncWorkerId());
}
$chunk = Chunk::fastDeserialize($this->chunk);

View File

@ -131,7 +131,7 @@ class AsyncPool{
private function getWorker(int $worker) : AsyncWorker{
if(!isset($this->workers[$worker])){
$this->workerUsage[$worker] = 0;
$this->workers[$worker] = new AsyncWorker($this->logger, $worker + 1, $this->workerMemoryLimit);
$this->workers[$worker] = new AsyncWorker($this->logger, $worker, $this->workerMemoryLimit);
$this->workers[$worker]->setClassLoader($this->classLoader);
$this->workers[$worker]->start(self::WORKER_START_OPTIONS);