![linux系統(tǒng)課程-課件09day09線程同步_第1頁](http://file4.renrendoc.com/view/80a135754eff5da45191cd77e03c8c75/80a135754eff5da45191cd77e03c8c751.gif)
![linux系統(tǒng)課程-課件09day09線程同步_第2頁](http://file4.renrendoc.com/view/80a135754eff5da45191cd77e03c8c75/80a135754eff5da45191cd77e03c8c752.gif)
![linux系統(tǒng)課程-課件09day09線程同步_第3頁](http://file4.renrendoc.com/view/80a135754eff5da45191cd77e03c8c75/80a135754eff5da45191cd77e03c8c753.gif)
![linux系統(tǒng)課程-課件09day09線程同步_第4頁](http://file4.renrendoc.com/view/80a135754eff5da45191cd77e03c8c75/80a135754eff5da45191cd77e03c8c754.gif)
![linux系統(tǒng)課程-課件09day09線程同步_第5頁](http://file4.renrendoc.com/view/80a135754eff5da45191cd77e03c8c75/80a135754eff5da45191cd77e03c8c755.gif)
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
分區(qū)分區(qū)linux-day09-PAGE3 constpthread_rwlockattr_t*restrictattr);pthread_rwlock_trwlock=intintintint分區(qū)分區(qū)linux-day09-線程同步的第PAGE6 pthread_mutex_t*restrictmutex,structtimespec}
time_t /*seconds*/longtv_nsec;/*nanosecondes*tv_sectime(NULL)+600==>設(shè)置超時(shí)pthread_mutex_t*restrict先釋放鎖constpthread_condattr_t*restrictattr);分區(qū)分區(qū)linux-day09-8 創(chuàng)建線程回收線程線程退出pthread_exit殺死線程pthread_cancel線程分離pthread_detach,也可以通過屬性設(shè)置pthread_attr_setdetachstate設(shè)置屬性分離,之前需要查看線程IDpthread_self在進(jìn)程內(nèi)唯一 intsem_init(sem_t*sem,intpshared,unsignedint0非0valueintsem_destroy(sem_t*sem);intsem_wait(sem_t*sem);釋放信號量value++intsem_post(sem_t分區(qū)linux-day09-9 分區(qū)linux-day09-10分區(qū)分區(qū)linux-day09-PAGE11 #defineEPERM 1/*Operationnotpermitted*/#defineENOENT 2/*Nosuchfileordirectory*/#defineESRCH 3/*Nosuchprocess*/#defineEINTR /*Interruptedsystemcall*/#defineEIO /*I/Oerror*/#defineENXIO /*Nosuchdeviceoraddress*/#defineE2BIG /*Argumentlisttoolong*/#defineENOEXEC /*Execformaterror*/#defineEBADF /*Badfilenumber*/#defineECHILD /*Nochildprocesses*/#defineEAGAIN /*Tryagain*/#defineENOMEM12/*Outofmemory*/#defineEACCES13/*Permissiondenied*/#defineEFAULT14/*Badaddress*/#defineENOTBLK15/*Blockdevicerequired*/#defineEBUSY 16/*Deviceorresourcebusy*/#defineEEXIST17/*Fileexists*/#defineEXDEV /*Cross-devicelink*/#defineENODEV /*Nosuchdevice*/#defineENOTDIR /*Notadirectory*/#defineEISDIR /*Isadirectory*/#defineEINVAL 22 /*Invalidargument*/#defineENFILE /*Filetableoverflow*/#defineEMFILE 24 /*Toomanyopenfiles*/#defineENOTTY /*Notatypewriter*/#defineETXTBSY /*Textfilebusy*/#defineEFBIG /*Filetoolarge*/#defineENOSPC /*Nospaceleftondevice*/#defineESPIPE /*Illegalseek*/#defineEROFS /*Read-onlyfilesystem*/#defineEMLINK /*Toomanylinks*/#define /*Brokenpipe#define /*Mathargumentoutofof#define /*Mathresultnotrepresentable#defineEDEADLK /*Resourcedeadlockwouldoccur*/#defineENALONG /*Filenametoolong*/#defineENOLCK /*Norecordlocksavailable*/#defineENOSYS /*Invalidsystemcallnumber*/#defineENOTEMPTY /*Directorynotempty*/#define /*Toomanysymboliclinks#defineEWOULDBLOCK EAGAIN/*Operationwouldblock*/#defineENOMSG /*Nomessageofdesiredtype*/#defineEIDRM /*Identifierremoved*/#defineECHRNG /*Channelnumberoutofrange*/#defineEL2NSYNC /*Level2notsynchronized*/#defineEL3HLT /*Level3halted*/#define /*Level3reset#defineELNRNG /*Linknumberoutofrange*/#defineEUNATCH /*Protocoldrivernotattached*/#defineENOCSI /*NoCSIstructureavailable*/#defineEL2HLT /*Level2halted*/#define /*Invalidexchange#defineEBADR 53 /*Invalidrequestdescriptor*/#defineEXFULL /*Exchangefull*/#define /*Noanode#defineEBADRQC /*Invalidrequestcode*/#defineEBADSLT /*Invalidslot*/#define #defineEBFONT /*Badfontfileformat*/#defineENOSTR /*Devicenotastream*/#defineENODATA /*Nodataavailable*/#defineETIME /*Timerexpired*/#define /*Outofstreamsresources#defineENONET /*Machineisnotonthenetwork*/#defineENOPKG 65 /*Packagenotinstalled*/#defineEREMOTE /*Objectisremote*/#defineENOLINK /*Linkhasbeensevered*/#defineEADV /*Advertiseerror*/#define /*Srmounterror#defineECOMM /*Communicationerroronsend*/#defineEPROTO /*Protocolerror*/#defineEMULTIHOP /*Multihopattempted*/#defineEDOTDOT /*RFSspecificerror*/#defineEBADMSG /*Notadatamessage*/#defineEOVERFLOW /*Valuetoolargefordefineddatatype*/#defineENOTUNIQ /*Namenotuniqueonnetwork*/#defineEBADFD /*Filedescriptorinbadstate*/#defineEREMCHG /*Remoteaddresschanged*/#define /*Cannotaccessaneededshared#defineELIBBAD /*Accessingacorruptedsharedlibrary*/ /*.libsectionina.outcorrupted*/#defineELIBMAX /*Attemptingtolinkintoomanysharedlibraries*/#define /*Cannotexecasharedlibrary#define /*Illegalbytesequence#defineERESTART /*Interruptedsystemcallshouldberestarted*/#defineESTRPIPE /*Streamspipeerror*/#defineEUSERS /*Toomanyusers*/#defineENOTSOCK88/*Socketoperationonnon-socket*/#defineEDESTADDRREQ89/*Destinationaddressrequired*/#defineEMSGSIZE90/*Messagetoolong*/#defineEPROTOTYPE /*Protocolwrongtypeforsocket*/#defineENOPROTOOPT /*Protocolnotavailable*/#defineEPROTONOSUPPORT93 /*Protocolnotsupported*/#defineESOCKTNOSUPPORT94 /*Sockettypenotsupported*/#defineEOPNOTSUPP /*Operationnotsupportedontransportendpoint*/#define /*Protocolfamilynotsupported#defineEAFNOSUPPORT /*Addressfamilynotsupportedbyprotocol*/#define /*Addressalreadyinuse#define /*Cannotassignrequested#define /*Networkisdown#defineENETUNREACH101/*Networkisunreachable*/#defineENETRESET102/*Networkdroppedconnectionbecauseofreset*/#defineECONNABORTED103/*Softwarecausedconnectionabort*/#define/*Connectionresetbypeer#define/*Nobufferspaceavailable#define/*Transportendpointisconnected#defineENOTCONN /*Transportendpointisnotconnected*/#defineESHUTDOWN /*Cannotsendaftertransportendpointshutdown*/#defineETOOMANYREFS /*Toomanyreferences:cannotsplice*/#defineETIMEDOUT /*Connectiontimedout*/#defineECONNREFUSED /*Connectionrefused*/#defineEHOSTDOWN /*Hostisdown*/#defineEHOSTUNREACH /*Noroutetohost*/#defineEALREADY /*Operationalreadyinprogress*/#defineEINPROGRESS /*Oper
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年依折麥布片項(xiàng)目投資可行性研究分析報(bào)告
- 2025年度國際金融衍生品交易管理合同
- 2025年度豪華婚禮策劃與執(zhí)行服務(wù)合同
- 2025年度果品產(chǎn)業(yè)鏈金融服務(wù)平臺合作協(xié)議
- 2025年國際貿(mào)易知識產(chǎn)權(quán)保護(hù)合同條款制定及執(zhí)行合同
- 2025年度建筑消防系統(tǒng)運(yùn)行維護(hù)與保障合同
- 2025年中國防靜電材料行業(yè)市場調(diào)查研究及發(fā)展戰(zhàn)略規(guī)劃報(bào)告
- 2025年機(jī)床設(shè)備租賃與維修服務(wù)合同
- 2025年中國馬養(yǎng)殖行業(yè)市場調(diào)查研究及投資前景預(yù)測報(bào)告
- 2025年度智能停車誘導(dǎo)系統(tǒng)設(shè)計(jì)與安裝合同
- 2025年初級社會工作者綜合能力全國考試題庫(含答案)
- 復(fù)工復(fù)產(chǎn)安全培訓(xùn)考試題
- vc約起來史上最全180個(gè)知名投資人聯(lián)系方式
- 中國酒文化英文介紹
- 部編版五年級語文下冊課文四字詞總結(jié)
- 社會穩(wěn)定風(fēng)險(xiǎn)評估報(bào)告風(fēng)險(xiǎn)評估參考
- 制冷操作證培訓(xùn)教材-制冷與空調(diào)設(shè)備運(yùn)行操作作業(yè)培課件
- 勞動(dòng)感悟800字作文30篇
- 上下樓梯安全我知道安全教育課件
- 市級臨床重點(diǎn)??粕陥?bào)書
- 《醫(yī)院重點(diǎn)專科建設(shè)專項(xiàng)資金管理辦法》
評論
0/150
提交評論