1 Star 0 Fork 6

northqd/async

forked from 方瑾/async 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
io.h 1.05 KB
一键复制 编辑 原始数据 按行查看 历史
#ifndef __IO_H__
#define __IO_H__
#include<signal.h>
#include<pthread.h>
#pragma comment(lib, "pthreadVC2.lib")
#include"array.h"
enum _IoType {
IO, SocketIO
};
typedef enum _IoType IoType;
enum _eventType {
AccessFileEvent
};
typedef enum _eventType EventType;
typedef struct ioEvent {
string id;
string path;
let result;
string error;
let otherParams;
let callback;
IoType ioType;
EventType eventType;
}*IoEvent;
#define newIoEvent() NEW(struct ioEvent)
typedef struct serviceThreadInfo {
pthread_t pid;
pthread_cond_t notifyCond;
pthread_cond_t waitTimeoutCond;
pthread_mutex_t waitTimeout;
pthread_mutex_t notify;
pthread_mutex_t undeal;
pthread_mutex_t finish;
pthread_mutex_t event;
}*ServiceThreadInfo;
#define newServiceThreadInfo() NEW(struct serviceThreadInfo)
typedef struct ioService {
Array undealQueue;
Array finishQueue;
ServiceThreadInfo serviceThreadInfo;
}*IoService;
#define newIoService() NEW(struct ioService)
// io¼
void runIO(let args);
void creatIoServicePthread(IoService service);
#endif // !__IO_H__
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/northqd2018/async.git
git@gitee.com:northqd2018/async.git
northqd2018
async
async
master

搜索帮助