[Lldb-commits] [lldb] [lldb] Fix premature MainLoop wakeup on windows (PR #117756)

via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 26 10:14:22 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Pavel Labath (labath)

<details>
<summary>Changes</summary>

The windows system APIs only take milliseconds. Make sure we round the sleep interval (in nanoseconds) upwards.

---
Full diff: https://github.com/llvm/llvm-project/pull/117756.diff


1 Files Affected:

- (modified) lldb/source/Host/windows/MainLoopWindows.cpp (+1-1) 


``````````diff
diff --git a/lldb/source/Host/windows/MainLoopWindows.cpp b/lldb/source/Host/windows/MainLoopWindows.cpp
index 0a5a35e9db9dde..f3ab2a710cd014 100644
--- a/lldb/source/Host/windows/MainLoopWindows.cpp
+++ b/lldb/source/Host/windows/MainLoopWindows.cpp
@@ -28,7 +28,7 @@ static DWORD ToTimeout(std::optional<MainLoopWindows::TimePoint> point) {
     return WSA_INFINITE;
 
   nanoseconds dur = (std::max)(*point - steady_clock::now(), nanoseconds(0));
-  return duration_cast<milliseconds>(dur).count();
+  return ceil<milliseconds>(dur).count();
 }
 
 MainLoopWindows::MainLoopWindows() {

``````````

</details>


https://github.com/llvm/llvm-project/pull/117756


More information about the lldb-commits mailing list