X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/ed144772874a7495b39abdf3bd9dbb0fe1c22fe8..703ad5b9a14dc2a42849669d3618a8ba1136bb92:/projects/stargazer/traffcounter_impl.cpp?ds=sidebyside diff --git a/projects/stargazer/traffcounter_impl.cpp b/projects/stargazer/traffcounter_impl.cpp index ae7f1dfb..da64a0b8 100644 --- a/projects/stargazer/traffcounter_impl.cpp +++ b/projects/stargazer/traffcounter_impl.cpp @@ -152,16 +152,9 @@ for (int i = 0; i < 25 && !stopped; i++) nanosleep(&ts, NULL); } -//after 5 seconds waiting thread still running. now kill it if (!stopped) - { - printfd(__FILE__, "kill TRAFFCOUNTER thread.\n"); - if (pthread_kill(thread, SIGINT)) - { - return -1; - } - printfd(__FILE__, "TRAFFCOUNTER killed\n"); - } + return -1; + printfd(__FILE__, "TRAFFCOUNTER::Stop()\n"); return 0; @@ -169,6 +162,10 @@ return 0; //----------------------------------------------------------------------------- void * TRAFFCOUNTER_IMPL::Run(void * data) { +sigset_t signalSet; +sigfillset(&signalSet); +pthread_sigmask(SIG_BLOCK, &signalSet, NULL); + TRAFFCOUNTER_IMPL * tc = static_cast(data); tc->stopped = false; int c = 0;