dummy_mutex.hpp 832 B

12345678910111213141516171819202122232425262728
  1. // A model of the Lockable concept from Boost.Thread which
  2. // does nothing. It can be passed as the Mutex template parameter
  3. // for a signal, if the user wishes to disable thread-safety
  4. // (presumably for performance reasons).
  5. // Copyright Frank Mori Hess 2008.
  6. // Distributed under the Boost Software License, Version
  7. // 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  8. // http://www.boost.org/LICENSE_1_0.txt)
  9. // See http://www.boost.org/libs/signals2 for library home page.
  10. #ifndef BOOST_SIGNALS2_DUMMY_MUTEX_HPP
  11. #define BOOST_SIGNALS2_DUMMY_MUTEX_HPP
  12. namespace boost {
  13. namespace signals2 {
  14. class dummy_mutex
  15. {
  16. public:
  17. void lock() {}
  18. bool try_lock() {return true;}
  19. void unlock() {}
  20. };
  21. } // end namespace signals2
  22. } // end namespace boost
  23. #endif // BOOST_SIGNALS2_DUMMY_MUTEX_HPP