12.12
来源:互联网 发布:淘宝客api调用 编辑:程序博客网 时间:2024/06/14 09:04
#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
struct menber
{
int a;
char *b;
}temp={8,"zieckey"};
void *create(void *arg)
{
printf("new thread ... \n");
return (void *)&temp;
}
int main(int argc,char *argv[])
{
int error;
pthread_t tid;
struct menber *c;
error = pthread_create(&tid, NULL, create, NULL);
if( error )
{
printf("new thread is not created ... \n");
return -1;
}
printf("main ... \n");
error = pthread_join(tid,(void *)&c);
if( error )
{
printf("new thread is not exit ... \n");
return -2;
}
printf("c->a = %d \n",c->a);
printf("c->b = %s \n",c->b);
sleep(1);
return 0;
}
#include <pthread.h>
#include <unistd.h>
struct menber
{
int a;
char *b;
}temp={8,"zieckey"};
void *create(void *arg)
{
printf("new thread ... \n");
return (void *)&temp;
}
int main(int argc,char *argv[])
{
int error;
pthread_t tid;
struct menber *c;
error = pthread_create(&tid, NULL, create, NULL);
if( error )
{
printf("new thread is not created ... \n");
return -1;
}
printf("main ... \n");
error = pthread_join(tid,(void *)&c);
if( error )
{
printf("new thread is not exit ... \n");
return -2;
}
printf("c->a = %d \n",c->a);
printf("c->b = %s \n",c->b);
sleep(1);
return 0;
}
0 0
- 12.12
- 12.12
- 12.12
- 12.12
- 12.12心得体会
- 12.12小结
- 12.12笔记
- 12.12扫雷编码
- #早安,努力#12.12
- 12.12 学习日记
- 小程序12.12
- 第九天早课12.12
- 12.12日 编程之旅
- 12.12 Panel 与 ScrollPane类
- javaScript--05 DOM基础 12.12
- 12.12-6个基础代码
- 12.12 IE7275-Data Mining笔记
- 六级词汇天天练(12.12)
- Android Stdio AVD RAM参数值太大不能启动
- getaddrinfo()函数详解
- 1.2线性表的顺序表示和实现
- Android 通知高度-文本宽高
- PHP使用数字作为SESSION的Key一刷新页面,Session就消失了
- 12.12
- Oracle Database 12c安装教程(Windows版)
- Windows API常用函数简单例子大全
- Android控件之日期与时间
- sql语句总结
- MyBatis if test 字符串判断问题
- 1.3.1线性链表之动态(malloc)链表
- 2016-12-12
- spring笔记一