Linux????????????
???????????? ???????[ 2015/1/22 13:57:33 ] ????????Linux ??????
??????????У?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???????????????????????????????????????
????????????????????????????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11