cThread
来源:互联网 发布:vscode 好用的插件 编辑:程序博客网 时间:2024/06/06 12:33
//
// cThread.h
// myTask
//
// Created by user on 12-4-10.
// Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//
#ifndef myTask_cThread_h
#define myTask_cThread_h
#include <stdio.h>
class textThread
{
private:
public:
textThread();
static void myThread();
void init();
static void * thread(void*);
};
#endif
//
// cThread.mm
// myTask
//
// Created by user on 12-4-10.
// Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//
#include <pthread.h>
#include <stdio.h>
#include <iostream>
#include "cThread.h"
textThread::textThread()
{
NSAutoreleasePool *pool = [[NSAutoreleasePoolalloc]init];
init();
[pool release];
}
void * textThread::thread(void *para)
{
int i;
for(i=0;i<3;i++)
printf("This is a pthread.\n");
returnNULL;
}
voidtextThread::init()
{
pthread_tid;
int ret;
/*int pthread_create(pthread_t * __restrict,
const pthread_attr_t * __restrict,
void *(*)(void *),
void * __restrict);*/
ret = pthread_create(&id,NULL,thread, this);
if(ret!=0){
printf ("Create pthread error!\n");
exit (1);
}
}
- cThread
- CThread
- CThread类
- CTHREAD C#
- CThread类
- FSBII(七)class CThread
- Windows下实现一个CThread封装类
- 介绍一个线程封装类(CThread)
- CThread - a Worker Thread wrapper class
- oralce 合并操作符用法
- ios版本的helloworld
- 0/1背包问题----动态规划实现
- Android文本自动提示框的简单应用实例
- jdbc
- cThread
- flashback off下delete和update表的恢复(flashback query技术)
- 面试时涉及的网络知识
- ETL介绍
- myThread
- 绘画设备和后端(Paint Devices and Backends)
- Ant+xdoclet管理hibernate配置文件
- msp430——时钟初始状态
- C/C++函数指针(typedef简化定义)