rmaprath added inline comments.

================
Comment at: include/__threading_support:593
+  using namespace chrono;
+  milliseconds ms = duration_cast<milliseconds>(ns);
+  if (ms.count() == 0 || ns > duration_cast<nanoseconds>(ms))
----------------
joerg wrote:
> Use (ns + 999999) so that the cast rounds up.
So, this code was lifted from the sources as-is. I will do this change, I think 
it makes sense.


================
Comment at: include/__threading_support:594
+  milliseconds ms = duration_cast<milliseconds>(ns);
+  if (ms.count() == 0 || ns > duration_cast<nanoseconds>(ms))
+    ++ms;
----------------
joerg wrote:
> Why is ns == 0 supposed to sleep at all? In fact, the caller already ensures 
> that can't happen?
IIUC, this is trying to detect round-downs and then compensate for it. With the 
above suggestion, this should no longer be needed. Will get rid of it as well.


https://reviews.llvm.org/D29630



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to