mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-12 14:35: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){
|
while(($task = $worker->unstack()) !== null){
|
||||||
//cancelRun() is not strictly necessary here, but it might be used to inform plugins of the task state
|
//cancelRun() is not strictly necessary here, but it might be used to inform plugins of the task state
|
||||||
//(i.e. it never executed).
|
//(i.e. it never executed).
|
||||||
|
assert($task instanceof AsyncTask);
|
||||||
$task->cancelRun();
|
$task->cancelRun();
|
||||||
$this->removeTask($task, true);
|
$this->removeTask($task, true);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user