void sig_handler1(int signo) { printf("I am in SIGINT handler ......\n"); } void *thread_func1(void *arg) { sigset_t s1; struct sigaction act1; printf("I m in 1 thread...pid=%lu....ppid=%lu..\n",getpid(),getppid()); sigfillset(&s1); sigdelset(&s1,SIGINT); // in case of other Signal , working fine pthread_sigmask(SIG_SETMASK,&s1,0); printf("before suspend t1 \n"); sigsuspend(&s1); // only one signal printf("After suspend t1 \n"); // ERROR ---- not coming here printf("exit from t1 \n"); pthread_exit(NULL); } int main() { sigfillset(&s1); sigdelset(&s1,SIGINT); sigprocmask(SIG_SETMASK,&s1,NULL); sigfillset(&act1.sa_mask); act1.sa_flags=0; act1.sa_handler=sig_handler1; sigaction(SIGINT,&act1,NULL); ----- ------ ------- pthread_attr_init(&tha1); pthread_attr_setschedpolicy(&tha1,SCHED_FIFO); p1.sched_priority=10; pthread_attr_setschedparam(&tha1,&p1); ret1=pthread_create(&tid[0],&tha1,thread_func1,NULL); if(ret1>0){printf("error is %s",strerror(ret1));exit(1);} printf("thread1 created......\n"); ----- ------ ------- sigsuspend(&s1); printf("111111111111111111 \n"); sigsuspend(&s1); printf("2222222222222222\n"); sigsuspend(&s1); printf("333333333333333333\n"); pthread_join(tid[0],NULL); pthread_join(tid[1],NULL); pthread_join(tid[2],NULL); pthread_join(tid[3],NULL); } OS - opensuse12.1 uname o/p- -> 3.7.10-1.45-desktop #1 SMP PREEMPT Tue Dec 16 20:27:58 UTC 2014 (4c885a1) x86_64 x86_64 x86_64 GNU/Linux
*** Bug 103921 has been marked as a duplicate of this bug. ***