[PATCH] D29630: [libcxx] Threading support: externalize sleep_for()

2017-02-09 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL294573: Threading support: externalize sleep_for() function. (authored by asiri). Changed prior to commit: https://reviews.llvm.org/D29630?vs=87669&id=8#toc Repository: rL LLVM https://reviews.l

[PATCH] D29630: [libcxx] Threading support: externalize sleep_for()

2017-02-08 Thread Joerg Sonnenberger via Phabricator via cfe-commits
joerg accepted this revision. joerg added a comment. One small issue left, otherwise LGTM. Comment at: include/__threading_support:187 +_LIBCPP_THREAD_ABI_VISIBILITY +void __libcpp_thread_sleep_for(const chrono::nanoseconds& ns); + Drop the name here. https:/

[PATCH] D29630: [libcxx] Threading support: externalize sleep_for()

2017-02-08 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath added a comment. In https://reviews.llvm.org/D29630#670876, @EricWF wrote: > In https://reviews.llvm.org/D29630#670873, @rmaprath wrote: > > > Sorry for the delay, I've updated the patch with all the comments addressed. > > > > @EricWF: Got one question before I commit: The `sleep_for` f

[PATCH] D29630: [libcxx] Threading support: externalize sleep_for()

2017-02-08 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF added a comment. In https://reviews.llvm.org/D29630#670873, @rmaprath wrote: > Sorry for the delay, I've updated the patch with all the comments addressed. > > @EricWF: Got one question before I commit: The `sleep_for` function in the > dylib (`thread.cpp`) is now quite small. Is there a

[PATCH] D29630: [libcxx] Threading support: externalize sleep_for()

2017-02-08 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath updated this revision to Diff 87669. rmaprath added a comment. Sorry for the delay, I've updated the patch with all the comments addressed. @EricWF: Got one question before I commit: The `sleep_for` function in the dylib (`thread.cpp`) is now quite small. Is there a particular reason to

[PATCH] D29630: [libcxx] Threading support: externalize sleep_for()

2017-02-07 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF accepted this revision. EricWF added a comment. This revision is now accepted and ready to land. LGTM. @joerg has raised some legitimate concerns about the Windows implementation. However that shouldn't hold this cleanup up, since the implementation is preexisting. Com

[PATCH] D29630: [libcxx] Threading support: externalize sleep_for()

2017-02-07 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath added inline comments. Comment at: include/__threading_support:593 + using namespace chrono; + milliseconds ms = duration_cast(ns); + if (ms.count() == 0 || ns > duration_cast(ms)) joerg wrote: > Use (ns + 99) so that the cast rounds up. So, this

[PATCH] D29630: [libcxx] Threading support: externalize sleep_for()

2017-02-07 Thread Joerg Sonnenberger via Phabricator via cfe-commits
joerg added inline comments. Comment at: include/__threading_support:367 + ts.tv_sec = ts_sec_max; + ts.tv_nsec = giga::num - 1; + } I don't think giga::num makes things any clear compared to just spelling it out. Comment at: include/

[PATCH] D29630: [libcxx] Threading support: externalize sleep_for()

2017-02-07 Thread Asiri Rathnayake via Phabricator via cfe-commits
rmaprath created this revision. Different platforms implement the wait/sleep behaviour in very different ways. It makes sense to hoist this functionality into the threading API. I also feel similarly about `hardware_concurrecy()` implementation. Any thoughts on that? https://reviews.llvm.org/