From ab89304ffd10925e2a06f8e0165c3d4ebf36c5f5 Mon Sep 17 00:00:00 2001 From: Torsten Hilbrich Date: Thu, 21 Feb 2013 15:53:18 +0100 Subject: [PATCH] base-linux: Don't busywait if lx_pollpid returns 0 This happened when I killed one of the genode clients which was tracked via an expception_handler. In this case the wait4 syscall returned 0 and the for(;;) was looped eternally. This caused an 100% CPU utilization for the core binary. --- base-linux/src/core/platform.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base-linux/src/core/platform.cc b/base-linux/src/core/platform.cc index a717c1767e..fc5e019819 100644 --- a/base-linux/src/core/platform.cc +++ b/base-linux/src/core/platform.cc @@ -102,7 +102,7 @@ void Platform::wait_for_exit() for (;;) { int const pid = lx_pollpid(); - if (pid == -1) + if (pid <= 0) break; Platform_thread::submit_exception(pid);