[PATCH] D36767: Implement the standard for timeouts for std::condition_variable

Tom via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 15 14:12:47 PDT 2017


tomcherry created this revision.

The C++ standard calls for wait_for() to use steady clock and
 wait_until() to use the clock that is provided as an argument.  This
 is not currently done in libc++ and is not possible with the pthreads
 API, however it is possible with the underlying futex system call.

      

This change re-implements std::condition_variable with a tweaked
 version of the implementation of pthread_cond_* from Android bionic to
 support the correct semantics.

      

Bug: 35756266


https://reviews.llvm.org/D36767

Files:
  include/__mutex_base
  src/condition_variable.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36767.111244.patch
Type: text/x-patch
Size: 10075 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170815/ef818b37/attachment.bin>


More information about the cfe-commits mailing list