欧美大屁股bbbbxxxx,狼人大香伊蕉国产www亚洲,男ji大巴进入女人的视频小说,男人把ji大巴放进女人免费视频,免费情侣作爱视频

歡迎來到入門教程網(wǎng)!

C語言

當前位置:主頁 > 軟件編程 > C語言 >

c語言多線程編程使用示例

來源:本站原創(chuàng)|時間:2020-01-10|欄目:C語言|點擊: 次

復制代碼 代碼如下:

#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>

#define THREAD_NUM 10

void *test(void *args) {
 printf("tid %d: i say 'Hello'.\n", args);
 return NULL;
}

int main() {
 int i, err;
 pthread_t child[THREAD_NUM];

 for(i = 0; i < THREAD_NUM; i++) {
  printf("Creating thread %d\n", i);
  err = pthread_create(&child[i], NULL, test, (void *) i);
  if(err) {
   printf("Can't create thread %d\n", i);
   exit(0);
  }
 }

 for(i = 0; i < THREAD_NUM; i++)
 pthread_join(child[i], NULL);

 printf("Thread initialize\n");
 return 0;
}

上一篇:window調用api列出當前所有進程示例

欄    目:C語言

下一篇:使用dc畫筆畫矩形、直線與橢圓示例

本文標題:c語言多線程編程使用示例

本文地址:http://mengdiqiu.com.cn/a1/Cyuyan/3695.html

網(wǎng)頁制作CMS教程網(wǎng)絡編程軟件編程腳本語言數(shù)據(jù)庫服務器

如果侵犯了您的權利,請與我們聯(lián)系,我們將在24小時內進行處理、任何非本站因素導致的法律后果,本站均不負任何責任。

聯(lián)系QQ:835971066 | 郵箱:835971066#qq.com(#換成@)

Copyright © 2002-2020 腳本教程網(wǎng) 版權所有