From ca54c7811cf03aded885d75a07a51a698bad2d99 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sat, 21 May 2022 00:18:17 +0200 Subject: [PATCH] Tweak that comment, because it had a confusing historical context that was not readily visible. --- frontend/ui/uimanager.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/ui/uimanager.lua b/frontend/ui/uimanager.lua index 0fa73365d..1a5a07793 100644 --- a/frontend/ui/uimanager.lua +++ b/frontend/ui/uimanager.lua @@ -1166,7 +1166,9 @@ function UIManager:_checkTasks() -- Pop the upcoming task, as it is due for execution... local task = table.remove(self._task_queue, 1) -- ...so do it now. - -- NOTE: Said task's action might modify _task_queue. Be wary of race conditions. (?) + -- 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? 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.