• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef BOOST_THREAD_SHARED_MUTEX_HPP
2 #define BOOST_THREAD_SHARED_MUTEX_HPP
3 
4 //  shared_mutex.hpp
5 //
6 //  (C) Copyright 2007 Anthony Williams
7 //  (C) Copyright 2011-2012 Vicente J. Botet Escriba
8 //
9 //  Distributed under the Boost Software License, Version 1.0. (See
10 //  accompanying file LICENSE_1_0.txt or copy at
11 //  http://www.boost.org/LICENSE_1_0.txt)
12 
13 #include <boost/thread/detail/config.hpp>
14 #if defined(BOOST_THREAD_PLATFORM_WIN32)
15 #if defined(BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN)
16 #if defined(BOOST_THREAD_V2_SHARED_MUTEX)
17 #include <boost/thread/v2/shared_mutex.hpp>
18 #else
19 #include <boost/thread/pthread/shared_mutex.hpp>
20 #endif
21 #else
22 #include <boost/thread/win32/shared_mutex.hpp>
23 #endif
24 #elif defined(BOOST_THREAD_PLATFORM_PTHREAD)
25 #if defined(BOOST_THREAD_V2_SHARED_MUTEX)
26 #include <boost/thread/v2/shared_mutex.hpp>
27 #else
28 #include <boost/thread/pthread/shared_mutex.hpp>
29 #endif
30 #else
31 #error "Boost threads unavailable on this platform"
32 #endif
33 
34 #include <boost/thread/lockable_traits.hpp>
35 
36 namespace boost
37 {
38   typedef shared_mutex shared_timed_mutex;
39   namespace sync
40   {
41 #ifdef BOOST_THREAD_NO_AUTO_DETECT_MUTEX_TYPES
42     template<>
43     struct is_basic_lockable<shared_mutex>
44     {
45       BOOST_STATIC_CONSTANT(bool, value = true);
46     };
47     template<>
48     struct is_lockable<shared_mutex>
49     {
50       BOOST_STATIC_CONSTANT(bool, value = true);
51     };
52 #endif
53 
54   }
55 }
56 
57 #endif
58