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
This commit is contained in:
39
docs/api/threading/task-system/createtaskgroup.md
Normal file
39
docs/api/threading/task-system/createtaskgroup.md
Normal file
@@ -0,0 +1,39 @@
|
||||
# TaskSystem::CreateTaskGroup
|
||||
|
||||
```cpp
|
||||
TaskGroup* CreateTaskGroup()
|
||||
```
|
||||
|
||||
创建一个任务组用于批量管理多个任务。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** `TaskGroup*` - 新创建的任务组指针
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**注意:**
|
||||
- 任务组必须通过 DestroyTaskGroup 显式销毁。
|
||||
- 任务组的所有权归调用者,TaskSystem 不负责销毁。
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
TaskGroup* group = TaskSystem::Get().CreateTaskGroup();
|
||||
|
||||
group->AddTask([]() { LoadTextures(); });
|
||||
group->AddTask([]() { LoadModels(); });
|
||||
group->AddTask([]() { LoadAudio(); });
|
||||
|
||||
group->SetCompleteCallback([]() {
|
||||
printf("All resources loaded!\n");
|
||||
});
|
||||
|
||||
group->Wait();
|
||||
TaskSystem::Get().DestroyTaskGroup(group);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [TaskSystem 总览](task-system.md) - 返回类总览
|
||||
- [DestroyTaskGroup](destroytaskgroup.md) - 销毁任务组
|
||||
Reference in New Issue
Block a user