[libcxx] r291342 - Ensure Sleep(...) isn't passed the value 0 on Windows
Eric Fiselier via cfe-commits
cfe-commits at lists.llvm.org
Sat Jan 7 01:53:28 PST 2017
Author: ericwf
Date: Sat Jan 7 03:53:28 2017
New Revision: 291342
URL: http://llvm.org/viewvc/llvm-project?rev=291342&view=rev
Log:
Ensure Sleep(...) isn't passed the value 0 on Windows
Modified:
libcxx/trunk/src/thread.cpp
Modified: libcxx/trunk/src/thread.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/thread.cpp?rev=291342&r1=291341&r2=291342&view=diff
==============================================================================
--- libcxx/trunk/src/thread.cpp (original)
+++ libcxx/trunk/src/thread.cpp Sat Jan 7 03:53:28 2017
@@ -119,7 +119,7 @@ sleep_for(const chrono::nanoseconds& ns)
{
#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
More information about the cfe-commits
mailing list