Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 10:09:31

0001 // Distributed under the Boost Software License, Version 1.0. (See
0002 // accompanying file LICENSE_1_0.txt or copy at
0003 // http://www.boost.org/LICENSE_1_0.txt)
0004 // (C) Copyright 2012 Vicente J. Botet Escriba
0005 
0006 #ifndef BOOST_THREAD_SHARED_LOCK_GUARD_HPP
0007 #define BOOST_THREAD_SHARED_LOCK_GUARD_HPP
0008 #include <boost/thread/detail/config.hpp>
0009 //#include <boost/thread/locks.hpp>
0010 #include <boost/thread/lock_options.hpp>
0011 #include <boost/thread/detail/delete.hpp>
0012 
0013 namespace boost
0014 {
0015 
0016     template<typename SharedMutex>
0017     class shared_lock_guard
0018     {
0019     private:
0020         SharedMutex& m;
0021 
0022     public:
0023         typedef SharedMutex mutex_type;
0024         BOOST_THREAD_NO_COPYABLE(shared_lock_guard)
0025         explicit shared_lock_guard(SharedMutex& m_):
0026             m(m_)
0027         {
0028             m.lock_shared();
0029         }
0030         shared_lock_guard(SharedMutex& m_,adopt_lock_t):
0031             m(m_)
0032         {}
0033         ~shared_lock_guard()
0034         {
0035             m.unlock_shared();
0036         }
0037     };
0038 
0039 #ifdef BOOST_THREAD_NO_AUTO_DETECT_MUTEX_TYPES
0040 
0041     template<typename T>
0042     struct is_mutex_type<shared_lock_guard<T> >
0043     {
0044         BOOST_STATIC_CONSTANT(bool, value = true);
0045     };
0046 
0047 
0048 #endif
0049 
0050 
0051 }
0052 
0053 #endif // header