lockable_wrapper.hpp 980 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Distributed under the Boost Software License, Version 1.0. (See
  2. // accompanying file LICENSE_1_0.txt or copy at
  3. // http://www.boost.org/LICENSE_1_0.txt)
  4. // (C) Copyright 2012 Vicente J. Botet Escriba
  5. #ifndef BOOST_THREAD_DETAIL_LOCKABLE_WRAPPER_HPP
  6. #define BOOST_THREAD_DETAIL_LOCKABLE_WRAPPER_HPP
  7. #include <boost/thread/detail/config.hpp>
  8. #if ! defined BOOST_THREAD_NO_CXX11_HDR_INITIALIZER_LIST
  9. #include <initializer_list>
  10. #endif
  11. #include <boost/config/abi_prefix.hpp>
  12. namespace boost
  13. {
  14. #if ! defined BOOST_THREAD_NO_CXX11_HDR_INITIALIZER_LIST
  15. namespace thread_detail
  16. {
  17. template <typename Mutex>
  18. struct lockable_wrapper
  19. {
  20. Mutex* m;
  21. explicit lockable_wrapper(Mutex& m_) :
  22. m(&m_)
  23. {}
  24. };
  25. template <typename Mutex>
  26. struct lockable_adopt_wrapper
  27. {
  28. Mutex* m;
  29. explicit lockable_adopt_wrapper(Mutex& m_) :
  30. m(&m_)
  31. {}
  32. };
  33. }
  34. #endif
  35. }
  36. #include <boost/config/abi_suffix.hpp>
  37. #endif // header