diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-07-07 15:41:41 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-07-08 13:29:54 +0100 |
commit | 35846a39614815032e4db0d2f26709983a9802d7 (patch) | |
tree | 093fee55cef231d49694405925ecfbc1bbb3464f /bitbake/lib/bb/event.py | |
parent | 9245c3b87fd56cd157de8f3e8ba1032a3a6be286 (diff) | |
download | poky-35846a39614815032e4db0d2f26709983a9802d7.tar.gz |
bitbake: event: Queue offline events for the UI
Messages printed when no UI is connected (e.g. memres) are currently lost.
Use the existing queue mechanism to queue these until a UI attaches, then
replay them. This isn't ideal but better than the current situation of
losing them entirely.
(Bitbake rev: cb241fb8544dfb05646dbae1a1b04e17878a466c)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/event.py')
-rw-r--r-- | bitbake/lib/bb/event.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py index 1462382f10..d5c5ef3544 100644 --- a/bitbake/lib/bb/event.py +++ b/bitbake/lib/bb/event.py | |||
@@ -212,6 +212,12 @@ def fire(event, d): | |||
212 | if worker_fire: | 212 | if worker_fire: |
213 | worker_fire(event, d) | 213 | worker_fire(event, d) |
214 | else: | 214 | else: |
215 | # If messages have been queued up, clear the queue | ||
216 | global _uiready, ui_queue | ||
217 | if _uiready and ui_queue: | ||
218 | for queue_event in ui_queue: | ||
219 | fire_ui_handlers(queue_event, d) | ||
220 | ui_queue = [] | ||
215 | fire_ui_handlers(event, d) | 221 | fire_ui_handlers(event, d) |
216 | 222 | ||
217 | def fire_from_worker(event, d): | 223 | def fire_from_worker(event, d): |
@@ -291,7 +297,10 @@ def register_UIHhandler(handler, mainui=False): | |||
291 | _ui_logfilters[_ui_handler_seq] = UIEventFilter(level, debug_domains) | 297 | _ui_logfilters[_ui_handler_seq] = UIEventFilter(level, debug_domains) |
292 | return _ui_handler_seq | 298 | return _ui_handler_seq |
293 | 299 | ||
294 | def unregister_UIHhandler(handlerNum): | 300 | def unregister_UIHhandler(handlerNum, mainui=False): |
301 | if mainui: | ||
302 | global _uiready | ||
303 | _uiready = False | ||
295 | if handlerNum in _ui_handlers: | 304 | if handlerNum in _ui_handlers: |
296 | del _ui_handlers[handlerNum] | 305 | del _ui_handlers[handlerNum] |
297 | return | 306 | return |