Skip to contentSkip to conversation

terminal: Add sleep in pid-monitor loop

PATCH New Jacob Kroon 1 participant 1 message Aug 4, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 terminal: Add sleep in pid-monitor loop

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.

---
 meta/lib/oe/terminal.py | 2 ++
 1 file changed, 2 insertions(+)
meta/lib/oe/terminal.py +2 -0
index 6d6a29f..3901ad3 100644
@@ -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
 
Signature · 1 line
2.7.4