linux c++開發(fā) 關(guān)于Linux線程pthread_join的用法?
關(guān)于Linux線程pthread_join的用法?Linux pthreadujoin用于掛起當(dāng)前線程(調(diào)用pthread)uthread指定的線程停止運(yùn)行之前,當(dāng)前線程不會(huì)繼續(xù)執(zhí)行。案例代碼:在Li
關(guān)于Linux線程pthread_join的用法?
Linux pthreadujoin用于掛起當(dāng)前線程(調(diào)用pthread)uthread指定的線程停止運(yùn)行之前,當(dāng)前線程不會(huì)繼續(xù)執(zhí)行。案例代碼:在Linux下,通過shell命令執(zhí)行上述案例代碼:如果子線程還沒有執(zhí)行完,主函數(shù)已經(jīng)退出,那么子線程也會(huì)退出,“pthread”;“join(PTH,null)”函數(shù)起作用。