]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/thread/test/test_7328.cpp
1 // Copyright (C) 2010 Vicente Botet
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 #define BOOST_THREAD_PROVIDES_INTERRUPTIONS
9 #include <boost/thread/thread_only.hpp>
10 #include <boost/detail/lightweight_test.hpp>
12 #if defined BOOST_THREAD_USES_CHRONO
14 //using namespace boost;
15 using namespace boost::chrono
;
17 bool interrupted
= false;
22 std::cout
<< "Starting sleep in thread" << std::endl
;
25 boost::this_thread::sleep_for(seconds(60));
28 catch (const boost::thread_interrupted
&)
31 std::cout
<< "Thread interrupted." << std::endl
;
40 std::cout
<< "Joined with thread." << std::endl
;
41 BOOST_TEST(interrupted
);
42 return boost::report_errors();
46 #error "Test not applicable: BOOST_THREAD_USES_CHRONO not defined for this platform as not supported"