Re: [Boost-bugs] [Boost C++ Libraries] #3567: Request for shared_lock_guard

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #3567: Request for shared_lock_guard
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-11-22 17:14:03


#3567: Request for shared_lock_guard
------------------------------+---------------------------------------------
 Reporter: andysem | Owner: anthonyw
     Type: Feature Requests | Status: new
Milestone: Boost 1.41.0 | Component: thread
  Version: Boost 1.40.0 | Severity: Optimization
 Keywords: lock_guard |
------------------------------+---------------------------------------------

Comment(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();
         }
     };
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3567#comment:1>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:01 UTC