thread_interruption.hpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef BOOST_THREAD_DETAIL_THREAD_INTERRUPTION_HPP
  2. #define BOOST_THREAD_DETAIL_THREAD_INTERRUPTION_HPP
  3. // Distributed under the Boost Software License, Version 1.0. (See
  4. // accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. // (C) Copyright 2007-9 Anthony Williams
  7. // (C) Copyright 2012 Vicente J. Botet Escriba
  8. #include <boost/thread/detail/config.hpp>
  9. #include <boost/thread/detail/delete.hpp>
  10. #if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS
  11. namespace boost
  12. {
  13. namespace this_thread
  14. {
  15. class BOOST_THREAD_DECL disable_interruption
  16. {
  17. bool interruption_was_enabled;
  18. friend class restore_interruption;
  19. public:
  20. BOOST_THREAD_NO_COPYABLE(disable_interruption)
  21. disable_interruption() BOOST_NOEXCEPT;
  22. ~disable_interruption() BOOST_NOEXCEPT;
  23. };
  24. class BOOST_THREAD_DECL restore_interruption
  25. {
  26. public:
  27. BOOST_THREAD_NO_COPYABLE(restore_interruption)
  28. explicit restore_interruption(disable_interruption& d) BOOST_NOEXCEPT;
  29. ~restore_interruption() BOOST_NOEXCEPT;
  30. };
  31. }
  32. }
  33. #endif // BOOST_THREAD_PROVIDES_INTERRUPTIONS
  34. #endif // header