mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-11 14:05:35 +00:00
AsyncPool: assert() that the unstacked task is actually an AsyncTask
it's possible that it might not be if the workers were accessed directly, but that shouldn't be possible. This also silences a PHPStan warning on level 2.
This commit is contained in:
parent
163ed225f2
commit
0890b5fc99
@ -263,6 +263,7 @@ class AsyncPool{
|
||||
while(($task = $worker->unstack()) !== null){
|
||||
//cancelRun() is not strictly necessary here, but it might be used to inform plugins of the task state
|
||||
//(i.e. it never executed).
|
||||
assert($task instanceof AsyncTask);
|
||||
$task->cancelRun();
|
||||
$this->removeTask($task, true);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user