]> git.proxmox.com Git - ceph.git/blame - ceph/src/Beast/extras/beast/test/sig_wait.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / Beast / extras / beast / test / sig_wait.hpp
CommitLineData
7c673cae
FG
1//
2// Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
3//
4// Distributed under the Boost Software License, Version 1.0. (See accompanying
5// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6//
7
8#ifndef BEAST_TEST_SIG_WAIT_HPP
9#define BEAST_TEST_SIG_WAIT_HPP
10
11#include <boost/asio.hpp>
12
13namespace beast {
14namespace test {
15
16/// Block until SIGINT or SIGTERM is received.
17inline
18void
19sig_wait()
20{
21 boost::asio::io_service ios;
22 boost::asio::signal_set signals(
23 ios, SIGINT, SIGTERM);
24 signals.async_wait(
25 [&](boost::system::error_code const&, int)
26 {
27 });
28 ios.run();
29}
30
31} // test
32} // beast
33
34#endif