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:
36
docs/api/threading/task-group/setcompletecallback.md
Normal file
36
docs/api/threading/task-group/setcompletecallback.md
Normal file
@@ -0,0 +1,36 @@
|
||||
# TaskGroup::SetCompleteCallback
|
||||
|
||||
```cpp
|
||||
void SetCompleteCallback(Callback&& callback)
|
||||
```
|
||||
|
||||
设置任务组完成回调。当所有任务都完成后,回调函数将在某个工作线程中被调用。
|
||||
|
||||
**参数:**
|
||||
- `callback` - 完成时要调用的回调函数
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
TaskGroup* group = TaskSystem::Get().CreateTaskGroup();
|
||||
|
||||
group->AddTask([]() { LoadTextures(); });
|
||||
group->AddTask([]() { LoadMeshes(); });
|
||||
group->AddTask([]() { LoadAudio(); });
|
||||
|
||||
group->SetCompleteCallback([]() {
|
||||
printf("All assets loaded!\n");
|
||||
ResourceManager::InitGPUResources();
|
||||
});
|
||||
|
||||
group->Wait();
|
||||
TaskSystem::Get().DestroyTaskGroup(group);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [TaskGroup 总览](task-group.md) - 返回类总览
|
||||
Reference in New Issue
Block a user