Re: [Cppcms-users] Can't catch signals after service::run()
Brought to you by:
artyom-beilis
|
From: CN <cn...@fa...> - 2013-12-10 02:14:42
|
Hmm... Below simple example shows that statements following run() never
get executed once the program is killed:
#include <iostream>
#include <cstring>
#include <cppcms/service.h>
#include <cppcms/thread_pool.h>
int main(int argc,char ** argv)
{
cppcms::thread_pool pool(3);
//pool.post(...); //Launch long running threads.
cppcms::service s(argc,argv);
s.run();
//Program counter never reaches here.
std::cerr<<"after run()"<<std::endl;
pool.stop(); //Wait until all threads complete.
return 0;
}
Can incorrect configuration content in config.js cause programs to
malfunction?
Best regards,
CN
On Tue, Dec 10, 2013, at 12:08 AM, Artyom Beilis wrote:
> By default, when the SIGTERM is sent to the application, the
> cppcms::run() exits and you can perform any cleanup you need.
>
> No need to do anything special.
>
> The situation described in wiki is for reloading (i.e. restarting the
> service rather than exiting the full program)
>
> Artyom Beilis
--
http://www.fastmail.fm - Access all of your messages and folders
wherever you are
|