C - 多線程(簡單):

1.先導入頭文件:

#include <pthread.h>

2.要寫的地方開始進行操作:

pthread_t t1;
pthread_create(&t1, NULL, t_pthread, NULL);
pthread_join(t1, NULL);


3.被多線程調用的方法:
void *t_pthread(void *args)
{
    archivePacket();
    return NULL;
}


發佈了80 篇原創文章 · 獲贊 13 · 訪問量 18萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章