summaryrefslogtreecommitdiffstats
path: root/libcxx/src/thread.cpp
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2017-01-07 09:53:28 +0000
committerEric Fiselier <eric@efcs.ca>2017-01-07 09:53:28 +0000
commit72771139f1a92de7e3327aefff9de88111a1193a (patch)
tree0fadb427f3d94590762123f4366a385193bb7995 /libcxx/src/thread.cpp
parentd52f4b86f3e9babaa457bf15be73e92ad82eee31 (diff)
downloadbcm5719-llvm-72771139f1a92de7e3327aefff9de88111a1193a.tar.gz
bcm5719-llvm-72771139f1a92de7e3327aefff9de88111a1193a.zip
Ensure Sleep(...) isn't passed the value 0 on Windows
llvm-svn: 291342
Diffstat (limited to 'libcxx/src/thread.cpp')
-rw-r--r--libcxx/src/thread.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libcxx/src/thread.cpp b/libcxx/src/thread.cpp
index 290e2aef983..5ccf829fb86 100644
--- a/libcxx/src/thread.cpp
+++ b/libcxx/src/thread.cpp
@@ -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
OpenPOWER on IntegriCloud