Modify

Opened 8 years ago

Closed 5 years ago

#3567 closed Feature Requests (fixed)

Request for shared_lock_guard

Reported by: andysem Owned by: viboes
Milestone: Boost 1.50.0 Component: thread
Version: Boost 1.40.0 Severity: Not Applicable
Keywords: lock_guard Cc: viboes

Description

It would be nice to have a lighter alternative for the shared_lock template, similar to the lock_guard alternative for the unique_lock.

Attachments (1)

3567.path (14.1 KB) - added by viboes 5 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 8 years ago by viboes

Something like that?

    template<typename Mutex>
    class shared_lock_guard
    {
    private:
        Mutex& m;

        explicit shared_lock_guard(shared_lock_guard&);
        shared_lock_guard& operator=(shared_lock_guard&);
    public:
        explicit shared_lock_guard(Mutex& m_):
            m(m_)
        {
            m.lock_shared();
        }
        shared_lock_guard(Mutex& m_,adopt_lock_t):
            m(m_)
        {}
        ~shared_lock_guard()
        {
            m.unlock_shared();
        }
    };

comment:2 Changed 8 years ago by andysem

Yes, exactly.

comment:3 Changed 8 years ago by viboes

  • Cc viboes added
  • Severity changed from Optimization to Not Applicable
  • Type changed from Feature Requests to Patches

comment:4 Changed 7 years ago by viboes

  • Type changed from Patches to Feature Requests

Comeback to Feature request as the patch is not complete.

comment:5 Changed 5 years ago by viboes

  • Owner changed from anthonyw to viboes
  • Status changed from new to assigned

comment:6 Changed 5 years ago by viboes

  • Milestone changed from Boost 1.41.0 to Boost 1.50.0

Changed 5 years ago by viboes

comment:7 Changed 5 years ago by viboes

Committed in trunk revision 77661.

comment:8 Changed 5 years ago by viboes

  • Resolution set to fixed
  • Status changed from assigned to closed

Committed in release branch at [78543]

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain viboes.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.