This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
On 18 June 2013 23:55, Jonathan Wakely wrote:
> Instead of fixing the bug three times I refactored the try_lock_xxx
> functions into a mixin template and used that in the various timed
> mutexes.
>
> PR libstdc++/57641
> * include/std/mutex (timed_mutex, recursive_timed_mutex): Move common
> functionality to new __timed_mutex_impl mixin. Overload try_lock_until
> to handle conversion between different clocks. Replace constrained
> __try_lock_for_impl overloads with conditional increment.
> * include/std/shared_mutex (shared_mutex::_Mutex): Use the new mixin.
> * testsuite/30_threads/timed_mutex/try_lock_until/57641.cc: New.
>
> Tested x86_64-linux, committed to trunk.
I've committed a less invasive version of this patch (without the
refactoring to add a new base class) to the 4.8 branch. Tested
x86_64-linux.
PR libstdc++/57641
* include/std/mutex (timed_mutex, recursive_timed_mutex): Add
overloaded _M_try_lock_until to handle conversion between different
clocks. Replace constrained __try_lock_for_impl overloads with
conditional increment.
* testsuite/30_threads/timed_mutex/try_lock_until/57641.cc: New.
Attachment:
patch.txt
Description: Text document
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |