12131
来源:互联网 发布:软件系统推广方案 编辑:程序博客网 时间:2024/06/03 19:43
#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
void *create(void *arg)
{
printf("new thread is created ... \n");
return (void *)8;
}
int main(int argc,char *argv[])
{
pthread_t tid;
int error;
void *temp;
error = pthread_create(&tid, NULL, create, NULL);
printf("main thread!\n");
if( error )
{
printf("thread is not created ... \n");
return -1;
}
error = pthread_join(tid, &temp);
if( error )
{
printf("thread is not exit ... \n");
return -2;
}
printf("thread is exit code %d \n", (int )temp);
return 0;
}
#include <pthread.h>
#include <unistd.h>
void *create(void *arg)
{
printf("new thread is created ... \n");
return (void *)8;
}
int main(int argc,char *argv[])
{
pthread_t tid;
int error;
void *temp;
error = pthread_create(&tid, NULL, create, NULL);
printf("main thread!\n");
if( error )
{
printf("thread is not created ... \n");
return -1;
}
error = pthread_join(tid, &temp);
if( error )
{
printf("thread is not exit ... \n");
return -2;
}
printf("thread is exit code %d \n", (int )temp);
return 0;
}
0 0
- 12131
- 12131
- 12131
- (已解)error:运行过程,捕捉不到元素
- android可控字数EditText
- JS自定义属性之切换图片事件
- 线性表的“增删改查”
- 133. Clone Graph :一个典型的DFS
- 12131
- Ubuntu下使用GStreamer开发简单的mp3播放器【转】
- 使用正则表达式校验时间,精确到秒,包括年月日时分秒,14位格式精确校验,正则表达式精确校验时间
- 12132
- 进程调度算法之FCFS
- android 购物车
- Darwin Streaming Server for Windows 安裝
- 使用Apache POI导出Excel数据有BUG
- 分类算法之决策树(Decision tree)