From 58777ff0d70fe48b954ce72be5d82b5efb2f07fd Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sat, 21 May 2022 00:26:06 +0200 Subject: [PATCH] Yeah, no, reverse iter wouldn't work. --- frontend/ui/uimanager.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/ui/uimanager.lua b/frontend/ui/uimanager.lua index 1a5a07793..00c33cba5 100644 --- a/frontend/ui/uimanager.lua +++ b/frontend/ui/uimanager.lua @@ -1167,8 +1167,8 @@ function UIManager:_checkTasks() local task = table.remove(self._task_queue, 1) -- ...so do it now. -- NOTE: Said task's action might modify _task_queue. - -- To avoid race conditions, we only ever check the head of the queue (c.f., #1758). - -- FIXME: Switch to a less confusing reverse for #len loop? + -- To avoid race conditions and catch new upcoming tasks during this call, + -- we repeatedly check the head of the queue (c.f., #1758). task.action(unpack(task.args, 1, task.argc)) else -- As the queue is sorted in ascending order, it's safe to assume all items are currently future tasks.