acl
3.5.3.0
|
#include "../stdlib/acl_define.h"
#include <time.h>
#include "../stdlib/acl_iterator.h"
#include "../stdlib/acl_ring.h"
类 | |
struct | ACL_TIMER_INFO |
struct | ACL_TIMER |
类型定义 | |
typedef struct ACL_TIMER_INFO | ACL_TIMER_INFO |
typedef struct ACL_TIMER | ACL_TIMER |
函数 | |
ACL_API acl_int64 | acl_timer_request (ACL_TIMER *timer, void *obj, acl_int64 delay) |
ACL_API acl_int64 | acl_timer_cancel (ACL_TIMER *timer, void *obj) |
ACL_API void * | acl_timer_popup (ACL_TIMER *timer) |
ACL_API acl_int64 | acl_timer_left (ACL_TIMER *timer) |
ACL_API void | acl_timer_walk (ACL_TIMER *timer, void(*action)(ACL_TIMER_INFO *, void *), void *arg) |
ACL_API ACL_TIMER * | acl_timer_new (void) |
ACL_API void | acl_timer_free (ACL_TIMER *timer, void(*free_fn)(void *)) |
ACL_API int | acl_timer_size (ACL_TIMER *timer) |
在文件 acl_timer.h 第 26 行定义.
typedef struct ACL_TIMER_INFO ACL_TIMER_INFO |
定时器类型定义
ACL_API acl_int64 acl_timer_cancel | ( | ACL_TIMER * | timer, |
void * | obj | ||
) |
取消定时任务
timer | {ACL_TIMER*},定时器句柄 |
obj | {void*},用户级动态变量 |
ACL_API void acl_timer_free | ( | ACL_TIMER * | timer, |
void(*)(void *) | free_fn | ||
) |
释放定时器句柄
timer | {ACL_TIMER*} |
free_fn | {void (*)(void*)} 释放定时器里的用户对象的回调释放函数 |
ACL_API acl_int64 acl_timer_left | ( | ACL_TIMER * | timer | ) |
距离下一个定时任务被触发的时间间隔
timer | {ACL_TIMER*},定时器句柄 |
ACL_API ACL_TIMER* acl_timer_new | ( | void | ) |
创建定时器句柄
ACL_API void* acl_timer_popup | ( | ACL_TIMER * | timer | ) |
从定时器中获取到时的定时任务
timer | {ACL_TIMER*},定时器句柄 |
ACL_API acl_int64 acl_timer_request | ( | ACL_TIMER * | timer, |
void * | obj, | ||
acl_int64 | delay | ||
) |
添加定时任务
timer | {ACL_TIMER*},定时器句柄 |
obj | {void*},用户级动态变量 |
delay | {acl_int64},被触发的时间间隔(微秒级) |
ACL_API int acl_timer_size | ( | ACL_TIMER * | timer | ) |
获得定时器里定时任务的数量
timer | {ACL_TIMER*} |
ACL_API void acl_timer_walk | ( | ACL_TIMER * | timer, |
void(*)(ACL_TIMER_INFO *, void *) | action, | ||
void * | arg | ||
) |
遍历定时器里的所有定时任务项
timer | {ACL_TIMER*},定时器句柄 |
action | {void (*)(ACL_TIMER_INFO*, void*)} 用户的遍历回调函数 |
arg | {void*} action 中的第二个参数 |