mirror of
https://git.yoctoproject.org/poky
synced 2026-09-12 15:49:36 +02:00
bitbake: event: Fix an event duplication race
It is possible for multple bitbake threads to empty ui_queue in parallel leading to duplicate console messages and much confusion when debuging. Use the lock to extract the queue data which means only one thread will processing, removing the duplicate out of order messages. (Bitbake rev: 945095602e40d54efb8de494218f4a2b25c9969f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -236,9 +236,12 @@ def fire(event, d):
|
||||
# If messages have been queued up, clear the queue
|
||||
global _uiready, ui_queue
|
||||
if _uiready and ui_queue:
|
||||
for queue_event in ui_queue:
|
||||
with bb.utils.lock_timeout_nocheck(_thread_lock):
|
||||
queue = ui_queue
|
||||
ui_queue = []
|
||||
for queue_event in queue:
|
||||
fire_ui_handlers(queue_event, d)
|
||||
ui_queue = []
|
||||
|
||||
fire_ui_handlers(event, d)
|
||||
|
||||
def fire_from_worker(event, d):
|
||||
|
||||
Reference in New Issue
Block a user