OGLplus  (0.59.0) a C++ wrapper for rendering APIs

eagine/signal_switch.cpp

Copyright Matus Chochlik. Distributed under the Boost Software License, Version 1.0. See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt

#include <iostream>
#include <thread>
auto main() -> int {
using namespace eagine;
int i = 0;
std::cout << "wait 10 seconds or send INT or TERM signal to exit"
<< std::endl;
while(!done) {
std::this_thread::sleep_for(std::chrono::seconds(1));
if(i++ >= 10) {
std::raise(SIGINT);
}
}
std::cout << "done" << std::endl;
return 0;
}
Common code is placed in this namespace.
Definition: eagine.hpp:21
Installs handlers for interrupt signals and flips switch on receipt.
Definition: signal_switch.hpp:23

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).