mirror of https://github.com/Icinga/icinga2.git
Wait for child processes before getting new tasks from the list.
This commit is contained in:
parent
c6e8013238
commit
cf920cd0f2
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue