int count = 0;
for (;;) {
- double timeout = 1;
+ double now, timeout = -1;
+
+ now = Utility::GetTime();
{
boost::mutex::scoped_lock lock(l_ProcessMutex);
pfds[i].events = POLLIN;
pfds[i].revents = 0;
- if (kv.second->GetTimeout() != 0 && kv.second->GetTimeout() < timeout)
- timeout = kv.second->GetTimeout();
+ if (kv.second->m_Timeout != 0) {
+ double delta = kv.second->m_Timeout - (now - kv.second->m_Result.ExecutionStart);
+
+ if (timeout == -1 || delta < timeout)
+ timeout = delta;
+ }
i++;
}
if (rc > 0) {
m_OutputStream.write(buffer, rc);
- return true;
+ continue;
}
break;