[OE-core] [PATCH] terminal: Add sleep in pid-monitor loop

Jacob Kroon jacob.kroon at gmail.com
Thu Aug 4 22:04:26 UTC 2016


Monitoring the process started by gnome-terminal was
spinning in a busy-loop. Insert some sleeping so that
we don't eat all the cpu.

Signed-off-by: Jacob Kroon <jacob.kroon at gmail.com>
---
 meta/lib/oe/terminal.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py
index 6d6a29f..3901ad3 100644
--- a/meta/lib/oe/terminal.py
+++ b/meta/lib/oe/terminal.py
@@ -76,9 +76,11 @@ class Gnome(XTerminal):
         finally:
             os.unlink(pidfile)
 
+        import time
         while True:
             try:
                 os.kill(pid, 0)
+                time.sleep(0.1)
             except OSError:
                return
 
-- 
2.7.4




More information about the Openembedded-core mailing list