[icinga-checkins] icinga.org: icinga2/master: Wait for child processes before getting new tasks from the list.

git at icinga.org git at icinga.org
Mon Feb 11 23:38:52 CET 2013


Module: icinga2
Branch: master
Commit: cf920cd0f22a76633a5b44187599227afc9fcd18
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=cf920cd0f22a76633a5b44187599227afc9fcd18

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Mon Feb 11 23:18:26 2013 +0100

Wait for child processes before getting new tasks from the list.

---

 lib/base/process.cpp |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/base/process.cpp b/lib/base/process.cpp
index b6b0d9d..9315c01 100644
--- a/lib/base/process.cpp
+++ b/lib/base/process.cpp
@@ -161,12 +161,6 @@ void Process::WorkerThreadProc(int taskFd)
 
 		int idx = 0;
 
-		if (tasks.size() < MaxTasksPerThread) {
-			pfds[idx].fd = taskFd;
-			pfds[idx].events = POLLIN;
-			idx++;
-		}
-
 		int fd;
 		BOOST_FOREACH(tie(fd, tuples::ignore), tasks) {
 			pfds[idx].fd = fd;
@@ -174,6 +168,12 @@ void Process::WorkerThreadProc(int taskFd)
 			idx++;
 		}
 
+		if (tasks.size() < MaxTasksPerThread) {
+			pfds[idx].fd = taskFd;
+			pfds[idx].events = POLLIN;
+			idx++;
+		}
+
 		int rc = poll(pfds, idx, -1);
 
 		if (rc < 0 && errno != EINTR)





More information about the icinga-checkins mailing list