![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)行舉報或認(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è)置超時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)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 二零二五年度辦公室裝修合同樣本:辦公空間綠化與景觀設(shè)計
- 電纜橋架購銷合同
- 數(shù)據(jù)分析技術(shù)在商業(yè)決策中的應(yīng)用研究
- 招投標(biāo)與合同管理第六章
- 三農(nóng)網(wǎng)信息化實施與管理手冊
- 外架工程勞務(wù)分包合同
- 農(nóng)業(yè)現(xiàn)代化生產(chǎn)作業(yè)指導(dǎo)書
- 公司個人租車合同
- 員工培訓(xùn)保密協(xié)議合同書
- 資料外包協(xié)議書
- 2025版茅臺酒出口業(yè)務(wù)代理及銷售合同模板4篇
- 2025年N1叉車司機考試試題(附答案)
- 2025年人教版數(shù)學(xué)五年級下冊教學(xué)計劃(含進(jìn)度表)
- 《醫(yī)院財務(wù)分析報告》課件
- 北師大版七年級上冊數(shù)學(xué)期末考試試題及答案
- 初中信息技術(shù)課堂中的項目式學(xué)習(xí)實踐研究結(jié)題報告
- 2024安全事故案例
- 2024年考研政治試題及答案
- 2024-2025學(xué)年人教版數(shù)學(xué)六年級上冊 期末綜合卷(含答案)
- 天津市部分區(qū)2023-2024學(xué)年高二上學(xué)期期末考試 物理 含解析
- 2024年考研管理類綜合能力(199)真題及解析完整版
評論
0/150
提交評論