Linux????????????
???????????? ???????[ 2015/1/22 13:57:33 ] ????????Linux ??????
?????????????????????????????????????????????δ???塣??????????pthread_join()???????????????????????????????????????????????Ч(????????????????)???????????????Ч????????????δ???塣?????δ??????????????ζ???pthread_t???????????????????????????????????????????????????????????3???????????????pthread_kill()???????????????????????kill()???????????????δ????????????????????(join)???????????pthread_kill()???????ESRCH???????????pthread_cancel()???????????????
?????????????Ч?????????????????????????pthread_kill()????????????2??裺
????1) ?????????????Running?????????????????
????2) ????????????????????????ThrdFunc??????Running?????棻
????3) ??????????????ThrdFunc????(return)?????(pthread_exit)?????????????????????????????????????????????Running?????????????????????????
????4) ???????????????????????????Running???????????pthread_kill()???????????????
????????????????????????????????????????????С???????δ?????????????????????????????????????????????????????????????????????????????????????????????????????????????0??????????????????????????????pthread_kill()?????????塣
?????? ???
??????????????????NPTL???????????????????????????????????????
??????????????????????????
1 static void SigHandler(int dwSigNo)
2 {
3 printf("++Thread %x Received Signal %2d(%s)!
"??
4 (unsigned int)pthread_self()?? dwSigNo?? strsignal(dwSigNo));
5 }
6 static void sighandler(int dwSigNo)
7 { //?????????????????
8 printf("--Thread %x Received Signal %2d(%s)!
"??
9 (unsigned int)pthread_self()?? dwSigNo?? strsignal(dwSigNo));
10 }
|
???????У?SigHandler()????????????sighandler()??????????????
????3.1 ???1
?????????????????У?sigwait()??sigwaitinfo()????????ж????
1intmain(void)
2{
3sigset_ttBlockSigs;
4sigemptyset(&tBlockSigs);
5sigaddset(&tBlockSigs??SIGINT);
6sigprocmask(SIG_BLOCK??&tBlockSigs??NULL);
7
8signal(SIGQUIT??sighandler);
9
10intdwRet;
11#ifdefUSE_SIGWAIT
12intdwSigNo;
13dwRet=sigwait(&tBlockSigs??&dwSigNo);
14printf("sigwaitreturns%d(%s)??signo=%d
"??dwRet??strerror(errno)??dwSigNo);
15#else
16siginfo_ttSigInfo;
17dwRet=sigwaitinfo(&tBlockSigs??&tSigInfo);
18printf("sigwaitinforeturns%d(%s)??signo=%d
"??dwRet??strerror(errno)??tSigInfo.si_signo);
19#endif
20
21return0;
22}
|
????????????(??-pthread???)????н?????£?
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
Linux??????DDR????????????Linux?????????????????豸??????????linux???в???????????м??????????????????????????Linux????Linux??DNS????????????γ???????????Linux?????????????Linux????(???)????????Linux ????????????????????????????????Windows???У?Linux???????Linux????????????????Linux iommu??vfio???????Linux????ε???TCP???????Linux?????????????СLinux?·???????????Linux???Jexus?й?Asp.Net Core??ó???Linux?????????Щ??
???·???
??????????????????
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????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????