Fix 14 broken cross-references in docs/api/threading/: - lambda-task path: lambdatask -> lambda-task (5 occurrences) - task-system-config path: tasksystemconfig -> task-system-config (6 occurrences) - read-write-lock self-ref: readwritelock -> read-write-lock (6 occurrences) - task-system cross-method: createtaskgroup/destroytaskgroup -> create-task-group/destroy-task-group - thread cross-method: getcurrentid/getid -> get-current-id/get-id Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
35 lines
682 B
Markdown
35 lines
682 B
Markdown
# TaskSystem::DestroyTaskGroup
|
|
|
|
```cpp
|
|
void DestroyTaskGroup(TaskGroup* group)
|
|
```
|
|
|
|
销毁一个任务组并释放其资源。
|
|
|
|
**参数:**
|
|
- `group` - 要销毁的任务组指针
|
|
|
|
**返回:** 无
|
|
|
|
**线程安全:** ✅ (内部使用 SpinLock 保护)
|
|
|
|
**复杂度:** O(1)
|
|
|
|
**注意:**
|
|
- 销毁时如果还有未完成的任务,这些任务将被取消。
|
|
- 传入 nullptr 无效果。
|
|
|
|
**示例:**
|
|
|
|
```cpp
|
|
TaskGroup* group = TaskSystem::Get().CreateTaskGroup();
|
|
// ... 添加任务 ...
|
|
|
|
TaskSystem::Get().DestroyTaskGroup(group);
|
|
```
|
|
|
|
## 相关文档
|
|
|
|
- [TaskSystem 总览](task-system.md) - 返回类总览
|
|
- [CreateTaskGroup](create-task-group.md) - 创建任务组
|