shared_mutex.hpp 1.2 KB

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