shared_mutex.hpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. typedef shared_mutex shared_timed_mutex;
  28. namespace sync
  29. {
  30. #ifdef BOOST_THREAD_NO_AUTO_DETECT_MUTEX_TYPES
  31. template<>
  32. struct is_basic_lockable<shared_mutex>
  33. {
  34. BOOST_STATIC_CONSTANT(bool, value = true);
  35. };
  36. template<>
  37. struct is_lockable<shared_mutex>
  38. {
  39. BOOST_STATIC_CONSTANT(bool, value = true);
  40. };
  41. #endif
  42. }
  43. }
  44. #endif