[libcxx-commits] [PATCH] D65339: Implement std::condition_variable via pthread_cond_clockwait() where available

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jul 26 10:49:56 PDT 2019


ldionne added a reviewer: ldionne.
ldionne added a comment.
Herald added a subscriber: dexonsmith.

So, to make sure I understand, this patch uses something that is *not yet* in POSIX, it's only proposed, correct?

Overall, I think this is a good direction since it patches a hole in `condition_variable`.



================
Comment at: include/__mutex_base:397
+condition_variable::wait_until(unique_lock<mutex>& __lk,
+                               const chrono::time_point<_Clock, _Duration>& __t)
+{
----------------
Can't you just overload on `chrono::time_point<chrono::system_clock, _Duration>&` and avoid the `enable_if` dance?


================
Comment at: include/__mutex_base:528
+    nanoseconds d = tp.time_since_epoch();
+    if (d > nanoseconds(0x59682F000000E941))
+        d = nanoseconds(0x59682F000000E941);
----------------
Please pardon my naiveness, but what is that number?


Repository:
  rCXX libc++

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

https://reviews.llvm.org/D65339





More information about the libcxx-commits mailing list