Files
XCSDD/docs/api/threading/task-system/update.md
ssdfasd 58a83f445a fix: improve doc link navigation and tree display
- Fix link resolution with proper relative/absolute path handling
- Improve link styling with underline decoration
- Hide leaf nodes from tree, only show directories
- Fix log file path for packaged app
2026-03-19 12:44:08 +08:00

37 lines
727 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# TaskSystem::Update
```cpp
void Update()
```
在主线程中处理主线程队列。执行所有通过 RunOnMainThread 提交的任务。
**参数:**
**返回:**
**复杂度:** O(n)n 为队列中待执行任务数
**使用场景:**
- 在主循环中调用,确保 RunOnMainThread 提交的任务能够执行。
- 应在渲染前调用。
**示例:**
```cpp
// 主循环
while (application.IsRunning()) {
TaskSystem::Get().Update(); // 处理主线程任务
// 渲染
Renderer.BeginFrame();
RenderScene();
Renderer.EndFrame();
}
```
## 相关文档
- [TaskSystem 总览](task-system.md) - 返回类总览
- [RunOnMainThread](runonmainthread.md) - 提交主线程任务