mutex.hpp 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. //
  2. // boost/signals2/mutex.hpp - header-only mutex
  3. //
  4. // Copyright (c) 2002, 2003 Peter Dimov and Multi Media Ltd.
  5. // Copyright (c) 2008 Frank Mori Hess
  6. //
  7. // Distributed under the Boost Software License, Version 1.0. (See
  8. // accompanying file LICENSE_1_0.txt or copy at
  9. // http://www.boost.org/LICENSE_1_0.txt)
  10. //
  11. // boost::signals2::mutex is a modification of
  12. // boost::detail::lightweight_mutex to follow the newer Lockable
  13. // concept of Boost.Thread.
  14. //
  15. #ifndef BOOST_SIGNALS2_MUTEX_HPP
  16. #define BOOST_SIGNALS2_MUTEX_HPP
  17. // MS compatible compilers support #pragma once
  18. #if defined(_MSC_VER)
  19. # pragma once
  20. #endif
  21. #include <boost/config.hpp>
  22. #if !defined(BOOST_HAS_THREADS)
  23. # include <boost/signals2/detail/lwm_nop.hpp>
  24. #elif defined(BOOST_HAS_PTHREADS)
  25. # include <boost/signals2/detail/lwm_pthreads.hpp>
  26. #elif defined(BOOST_HAS_WINTHREADS)
  27. # include <boost/signals2/detail/lwm_win32_cs.hpp>
  28. #else
  29. // Use #define BOOST_DISABLE_THREADS to avoid the error
  30. # error Unrecognized threading platform
  31. #endif
  32. #endif // #ifndef BOOST_SIGNALS2_MUTEX_HPP