Net/include/clock.h

43 lines
772 B
C
Raw Normal View History

2019-01-17 14:55:52 +00:00
//
// clock.hpp
// Net
//
// Created by 胡一兵 on 2019/1/17.
// Copyright © 2019年 Bakantu. All rights reserved.
//
#ifndef clock_h
#define clock_h
#include "type.h"
//时钟管理结构
struct clock_register{
void *(*func)(void *);
bool if_thread;
2019-02-03 16:26:45 +00:00
bool if_reset = false;
2019-01-17 14:55:52 +00:00
int click;
2019-02-02 13:55:17 +00:00
int rawclick;
void *arg;
};
struct clock_thread_info{
uint32_t tid = 0;
pthread_t pht = 0;
void *args = NULL;
clock_register *pcr;
2019-01-17 14:55:52 +00:00
};
//初始化全局时钟
2019-01-17 15:03:24 +00:00
void initClock(void);
2019-01-17 14:55:52 +00:00
//设置全局线程时钟
void setThreadsClock(void);
//时钟滴答调用函数
void threadsClock(int);
2019-02-02 13:55:17 +00:00
//时钟线程完结前调用此函数进行标记
void clockThreadFinish(uint32_t tid);
2019-02-03 16:26:45 +00:00
void newClock(clock_register *pncr);
2019-01-17 14:55:52 +00:00
#endif /* clock_h */