线程的编程练习
来源:互联网 发布:python 字典值为空 编辑:程序博客网 时间:2024/06/03 14:02
#include <stdio.h>#include <pthread.h>#include <unistd.h>#include <stdlib.h>struct menber{ int a; char *s;};void *create(void *arg){ struct menber *temp; temp=(struct menber *)arg; printf("menber->a = %d \n",temp->a); printf("menber->s = %s \n",temp->s); return (void *)0;}int main(int argc,char *argv[]){ pthread_t tidp; int error; struct menber *b; b=(struct menber *)malloc( sizeof(struct menber) ); b->a = 4; b->s = "zieckey"; error = pthread_create(&tidp, NULL, create, (void *)b); if( error ) { printf("phread is not created...\n"); return -1; } sleep(1); printf("pthread is created...\n"); return 0;}
0 0
- 线程的编程练习
- 线程的编程练习
- 线程的编程练习
- 线程编程练习
- 线程编程练习2
- unix环境线程编程练习
- 巩固C语言(八)----进程和线程的区别和练习 & 线程编程
- Linux编程练习 --多线程1--线程创建
- Linux编程练习 --多线程1--线程创建
- Linux编程练习 --多线程1--线程创建
- NDK编程之SDL(2.0)线程练习
- 各种各样的 编程练习
- 编程练习的必备
- 超线程的相关练习
- 线程的join方法练习
- 线程练习
- 线程练习
- 线程练习
- iOS 录音,播放并上传
- java 反射详解
- 浅谈溢出
- md5加密原理
- 1001. 害死人不偿命的(3n+1)猜想 (15)
- 线程的编程练习
- Error running app: Instant Run requires 'Tools | Android | Enable ADB integration' to be enabled.
- android.useDeprecatedNdk=true 添入工程根目录下的新建 gradle.properties 文件
- 前台、后台、前端、后端的区别
- 1097. Deduplication on a Linked List (25)
- bzoj 2288: 【POJ Challenge】生日礼物 贪心+优先队列
- lintcode,最长无重复字符的子串
- HDU 3746 字符串匹配(字符串的最小循环节问题)
- 链表中基数排序