2
0
mirror of https://github.com/boostorg/thread.git synced 2026-01-20 17:12:13 +00:00
Files
thread/test/test_366_3.cpp
Peter Dimov 78af23ca14 Remove tabs
2022-12-31 20:01:31 +02:00

36 lines
852 B
C++

// Copyright 2022 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include "boost/thread/scoped_thread.hpp"
#include "boost/thread.hpp"
#include <boost/core/lightweight_test.hpp>
#include <iostream>
static void inner_thread_func()
{
boost::this_thread::sleep_for(
boost::chrono::hours(1) );
}
static void outer_thread_func()
{
boost::strict_scoped_thread<boost::interrupt_and_join_if_joinable> inner( inner_thread_func );
}
static void double_interrupt()
{
boost::strict_scoped_thread<boost::interrupt_and_join_if_joinable> outer( outer_thread_func );
}
int main()
{
BOOST_TEST( true ); // perform lwt initialization
std::cout << "Start" << std::endl;
double_interrupt();
std::cout << "End" << std::endl;
return boost::report_errors();
}