Ensure Sleep(...) isn't passed the value 0 on Windows
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291342 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/src/thread.cpp b/src/thread.cpp
index 290e2ae..5ccf829 100644
--- a/src/thread.cpp
+++ b/src/thread.cpp
@@ -119,7 +119,7 @@
{
#if defined(_LIBCPP_WIN32API)
milliseconds ms = duration_cast<milliseconds>(ns);
- if (ns > duration_cast<nanoseconds>(ms))
+ if (ms.count() == 0 || ns > duration_cast<nanoseconds>(ms))
++ms;
Sleep(ms.count());
#else