ypc
|
2a692cada5
|
[重构] libtask 完整重写 + 全项目注释中文化
libtask 变更(对比原工程无功能遗漏):
- 定时器: timerfd + epoll 精确毫秒级(替代简单轮询)
- 事件: TASK_EVENT_FLAG_AND/OR/CLEAR, TASK_EVENT_WAIT_FOREVER
- 消息队列: 长度前缀存储, send/send_timeout/recv/try_recv
- 引用计数: task_event/timer/msgq 安全析构
- 新增 task_sleep_ms 通用延时函数
- 回调类型修正为 void(*)(void*)
注释中文化:
- myBase.h/list.h/myMd5.h/myLog.h → 全部中文
- myFunc.c 节标题 → 中文
- myTask.h/c → 全部中文注释
风格修复:
- 一行一语句, {} 独占行, } 后空行, return 前空行
- 运算符前后空格, 逗号分号后空格
|
2026-07-07 15:01:13 +08:00 |
ypc
|
f2a099e4b9
|
[阶段1-B2] libtask 自研实现 — 定时器/事件/消息队列三大子系统
基于 SPEC §8 完整实现 (21 API):
- Timer: create/start/stop/restart/destroy/is_active, 独立轮询线程10ms
- Event: create/destroy/send/recv(AND|OR)/clear/query, 位图+cond同步
- MsgQueue: create/destroy/send/send_timeout/recv/try_recv/count/space, 环形缓冲
- C接口 + extern "C", C++内部 pthread, test: Timer=3 Event=0x5 Msg=hi
|
2026-07-07 14:44:49 +08:00 |