Opened 7 years ago

Closed 7 years ago

#11424 closed Feature Requests (fixed)

Provide shared_timed_mutex as an alternative name for shared_mutex and deprecate the use of shared_mutex as a timed mutex

Reported by: Edward Diener Owned by: viboes
Milestone: Boost 1.60.0 Component: thread
Version: Boost Development Trunk Severity: Not Applicable
Keywords: Cc:

Description

In C++14 the std::shared_mutex class has been renamed to std::shared_timed_mutex ( http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3891.htm ) and a non-timed shared_mutex has been proposed ( http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4241.htm ). In order to remain compatible to C++14 the boost thread library could have boost::shared_timed_mutex be the same as the current boost::shared_mutex and could deprecate the current use of boost::shared_mutex. Deprecating the use of boost::shared_mutex in favor of boost::shared_timed_mutex would enable end-users to change their usage of boost::shared_mutex to boost::shared_timed_mutex until such time when boost::shared_mutex is recoded as a non-timed shared mutex class.

Change History (4)

comment:1 by viboes, 7 years ago

Owner: changed from Anthony Williams to viboes
Status: newassigned

IIRC the proposal has been accepted for C++17. I agree the changes can be done respecting backward compatibility

Do you mind to do a Pull request on github?

comment:2 by Edward Diener, 7 years ago

I made a pull request on Github. I did not attempt to update the thread documentation to deprecate shared_mutex in favor of shared_timed_mutex but leave that up to the thread developer(s) to document. I did test out the PR using the current thread/test jamfile and it does work. I did not attempt to test out the PR by using other Boost libraries which may be using shared_mutex, but since my solution is essentially "renaming" shared_mutex to shared_timed_mutex and typedefing, for the time being, shared_mutex back to shared_timed_mutex there should not be any problems from the point of view of the end-user.

comment:3 by viboes, 7 years ago

Milestone: To Be DeterminedBoost 1.60.0

comment:4 by viboes, 7 years ago

Resolution: fixed
Status: assignedclosed

typedef added. Considered enough for the time being.

Note: See TracTickets for help on using tickets.