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?
Differential D29630
[libcxx] Threading support: externalize sleep_for() rmaprath on Feb 7 2017, 4:38 AM. Authored by
Details 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?
Diff Detail
Event Timeline
Comment Actions LGTM. @joerg has raised some legitimate concerns about the Windows implementation. However that shouldn't hold this cleanup up, since the implementation is preexisting.
Comment Actions 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 keep it there? I was wondering if we should move that bit to the <thread> header altogether. Comment Actions One small issue left, otherwise LGTM.
|