X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/ed144772874a7495b39abdf3bd9dbb0fe1c22fe8..2ea67b39f9cade2b55cfbbd554af1049c1c69fd9:/projects/stargazer/traffcounter_impl.cpp 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;