I've got such a signal handler:
void my_signal_handler(int signo )
{
sigset_t sa_mask;
sigsetemptyset(&sa_mask);
sigaddset(&sa_mask, SIGINT);
int res = pthread_sigmask(SIG_BLOCK, &sa_mask, NULL);
int i;
for(i=0;i<NUM_OF_THREADS;i++) {
pthread_kill(my_threads[i], SIGINT);
}
}
I use it to handle SIGINT. It has to turn off other threads when it receives a SIGINT. I'm trying to block SIGINT in the thread not to cause signal storm. Unfortunately signals don't stop to send. What I'm doing wrong?