浏览代码

Fixed poll timeout rounding

Paul-Louis Ageneau 3 年之前
父节点
当前提交
0e2579ead4
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/impl/pollservice.cpp

+ 1 - 1
src/impl/pollservice.cpp

@@ -176,7 +176,7 @@ void PollService::runLoop() {
 				int timeout;
 				int timeout;
 				if (next) {
 				if (next) {
 					auto msecs = duration_cast<milliseconds>(
 					auto msecs = duration_cast<milliseconds>(
-					    std::max(clock::duration::zero(), *next - clock::now()));
+					    std::max(clock::duration::zero(), *next - clock::now() + 1ms));
 					PLOG_VERBOSE << "Entering poll, timeout=" << msecs.count() << "ms";
 					PLOG_VERBOSE << "Entering poll, timeout=" << msecs.count() << "ms";
 					timeout = static_cast<int>(msecs.count());
 					timeout = static_cast<int>(msecs.count());
 				} else {
 				} else {