[PATCH] D28220: provide Win32 native threading

Andrey Khalyavin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 4 23:35:15 PST 2017


halyavin added inline comments.


================
Comment at: include/__threading_support:474
+      system_clock::time_point(duration_cast<system_clock::duration>(duration));
+  auto timeout_ms = duration_cast<milliseconds>(abstime - system_clock::now());
+
----------------
Since negative timeouts can't be avoided, we must make sure that timeout_ms.count() is at least zero.


================
Comment at: include/__threading_support:476
+
+  _LIBCPP_ASSERT(timeout_ms.count() > INFINITE && "timeout duration overflow");
+  if (!SleepConditionVariableSRW(__cv, __m, timeout_ms.count(), 0))
----------------
It is >= INFINITE. _LIBCPP_ASSERT has 2 arguments and supports error message out of the box.


Repository:
  rL LLVM

https://reviews.llvm.org/D28220





More information about the cfe-commits mailing list