TaskScheduler: throw an exception if attempting to heartbeat a disabled scheduler

This commit is contained in:
Dylan K. Taylor 2022-03-03 18:49:17 +00:00
parent c9c50e16ec
commit dfd8c4e4b8
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -130,6 +130,9 @@ class TaskScheduler{
}
public function mainThreadHeartbeat(int $currentTick) : void{
if(!$this->enabled){
throw new \LogicException("Cannot run heartbeat on a disabled scheduler");
}
$this->currentTick = $currentTick;
while($this->isReady($this->currentTick)){
/** @var TaskHandler $task */