simple_locking.hpp 960 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /* Copyright 2006-2008 Joaquin M Lopez Munoz.
  2. * Distributed under the Boost Software License, Version 1.0.
  3. * (See accompanying file LICENSE_1_0.txt or copy at
  4. * http://www.boost.org/LICENSE_1_0.txt)
  5. *
  6. * See http://www.boost.org/libs/flyweight for library home page.
  7. */
  8. #ifndef BOOST_FLYWEIGHT_SIMPLE_LOCKING_HPP
  9. #define BOOST_FLYWEIGHT_SIMPLE_LOCKING_HPP
  10. #if defined(_MSC_VER)
  11. #pragma once
  12. #endif
  13. #include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
  14. #include <boost/flyweight/detail/recursive_lw_mutex.hpp>
  15. #include <boost/flyweight/simple_locking_fwd.hpp>
  16. #include <boost/flyweight/locking_tag.hpp>
  17. /* simple locking policy based on native recursive mutexes */
  18. namespace boost{
  19. namespace flyweights{
  20. struct simple_locking:locking_marker
  21. {
  22. typedef detail::recursive_lightweight_mutex mutex_type;
  23. typedef mutex_type::scoped_lock lock_type;
  24. };
  25. } /* namespace flyweights */
  26. } /* namespace boost */
  27. #endif