[libcxx-commits] [PATCH] D99175: [libcxx] [test] Make the condvar wait_for tests less brittle

Marek Kurdej via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Apr 1 02:28:16 PDT 2021


curdeius added inline comments.


================
Comment at: libcxx/test/std/thread/thread.condition/thread.condition.condvar/wait_for.pass.cpp:49-52
+    do {
+        now = Clock::now();
+        if (now >= wait_end) break;
+    } while (test2 == 0 && cv.wait_for(lk, wait_end - now) == std::cv_status::no_timeout);
----------------
How about this to fix the possible negative duration?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99175



More information about the libcxx-commits mailing list