[libcxx-commits] [PATCH] D63328: [libc++] Avoid using timespec when it might not be available

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jun 18 05:20:55 PDT 2019


ldionne accepted this revision.
ldionne added a comment.
This revision is now accepted and ready to land.

In D63328#1547894 <https://reviews.llvm.org/D63328#1547894>, @miyuki wrote:

> `__libcpp_condvar_timedwait` needs to be implemented in a different TU, so it can't be a template and at the same time it needs some sort of time point. I think `timespec` was chosen because it is what `pthread_cond_timedwait` expects. Do you think a specialization of `chrono::time_point` (like `chrono::time_point<chrono::system_clock, chrono::nanoseconds>` used by `condition_variable::__do_timed_wait`) would make more sense here?


My comment was more specifically that it feels weird that the definition of `timespec`, a time-related type, is tied to `_LIBCPP_HAS_NO_THREADS`. I would expect it to be tied to something else more general, perhaps.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63328/new/

https://reviews.llvm.org/D63328





More information about the libcxx-commits mailing list