Opened 2 years ago

Closed 2 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:


In C++14 the std::shared_mutex class has been renamed to std::shared_timed_mutex ( ) and a non-timed shared_mutex has been proposed ( ). 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.

Attachments (0)

Change History (4)

comment:1 Changed 2 years ago by viboes

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 Changed 2 years ago by Edward Diener

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 Changed 2 years ago by viboes

Milestone: To Be DeterminedBoost 1.60.0

comment:4 Changed 2 years ago by viboes

Resolution: fixed
Status: assignedclosed

typedef added. Considered enough for the time being.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain viboes.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.