??????????У?SigThread????????SIGUSR1???????????????????????????????????????gWorkFlag????????pthread_cond_signal()????WkrThread????WkrThread?????????????????????????????????????????????????????????????????????????????????????
???????????????н?????£?

 

1 [wangxiaoyuan_@localhost~ ]$ ./Sigwait &
2 [1] 3940
3 [wangxiaoyuan_@localhost~ ]$ Worker thread starts!
4 kill -USR1 3940
5 Worker thread starts working...
6 [wangxiaoyuan_@localhost~ ]$ ps
7   PID TTY          TIME CMD
8  3940 pts/12   00:00:31 Sigwait
9  4836 pts/12   00:00:00 ps
10 32206 pts/12   00:00:00 bash
11 [wangxiaoyuan_@localhost~ ]$ kill -KILL 3940
12 [wangxiaoyuan_@localhost~ ]$ ps
13   PID TTY          TIME CMD
14  5664 pts/12   00:00:00 ps
15 32206 pts/12   00:00:00 bash
16 [1]+  Killed                  ./Sigwait

???????У?????kill -USR1??kill -KILL???????kill -10??kill -9??
?????????????????????????????????????????Ч??
????3.4 ???4
???????????sigwait()?????????????????????????????????????????????
????1 int main(void)
????2 {
????3     //1. ???????????(pthread_create)
????4     //2. ??????????SIGINT???(sigwait)
????5     //3. ??????????
????6     //4. ???????(exit)
????7 }
????????????????SIGINT/SIGQUIT???????????????????
??????  ???
????Linux??????У??????????1)????????????????????????2)??????????????????????????????У??????????????
??????????????????????????????????????????????(????????)????SIGKILL??SIGSTOP??
??????????????????????SIGFPE/SIGILL/SIGSEGV/SIGBUS?????????????????????????
???????????????????Щ???(????????????????)????????sigwait()?????????????????????
???????????????е???sigwait()?????????????????????ú????????????
????????????????????????????????????????????SIGALARM???????????????????????????????????????
????????????????????????????????????????????????????