Skip to content

Commit 17b8785

Browse files
authored
[lldb] Fix premature MainLoop wakeup on windows (#117756)
The windows system APIs only take milliseconds. Make sure we round the sleep interval (in nanoseconds) upwards.
1 parent 7e312c3 commit 17b8785

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lldb/source/Host/windows/MainLoopWindows.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static DWORD ToTimeout(std::optional<MainLoopWindows::TimePoint> point) {
2828
return WSA_INFINITE;
2929

3030
nanoseconds dur = (std::max)(*point - steady_clock::now(), nanoseconds(0));
31-
return duration_cast<milliseconds>(dur).count();
31+
return ceil<milliseconds>(dur).count();
3232
}
3333

3434
MainLoopWindows::MainLoopWindows() {

0 commit comments

Comments
 (0)