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]

[patch] fix libstdc++/57641


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.

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]