pthread_create的用法
2007-02-12 13:39
288 查看
由于pthread库不是Linux系统默认的库,所以在使用pthread_create创建线程时,在编译中请加-lpthread参数,例如:
#include "pthread.h"
#include "stdio.h"
void* thread_test(void* ptr)
{
printf("test");
}
int main()
{
pthread_t pid;
pthread_create(&pid, NULL, test_thread, NULL);
return 0;
}
#include "pthread.h"
#include "stdio.h"
void* thread_test(void* ptr)
{
printf("test");
}
int main()
{
pthread_t pid;
pthread_create(&pid, NULL, test_thread, NULL);
return 0;
}
相关文章推荐
- pthread_create用法 http://blog.csdn.net/tommy_wxie/article/details/8545253
- pthread_create用法
- pthread_create用法
- pthread_create()函数用法
- pthread_create用法 c线程
- pthread_create用法上的小问题
- pthread_create 用法多线程文件拷贝。
- 版本加载一些用户态用法总结--pthread_create函数用法
- pthread_create用法
- pthread_create()函数用法
- pthread_create用法
- pthread_create 函数用法
- 【转】 pthread_create用法
- pthread_create用法
- 【转】 pthread_create用法
- pthread_create用法
- pthread_create用法
- pthread_key_create用法
- pthread_create用法(转)
- pthread_once和pthread_key_create的用法演示