Fixed discrepancies between source code and documentation: - AsyncLoader: Document Initialize() ignores workerThreadCount, Submit() doesn't do actual async loading, Update() is stub - ResourceManager: Document UnloadUnused() and ReloadResource() are stubs - ResourceCache: Document OnZeroRefCount() and Flush() are stubs - ResourceDependencyGraph: Document TopologicalSort() returns empty (stub) - ResourceFileSystem: Document GetResourceInfo() doesn't fill modifiedTime, EnumerateResources() is stub - FileArchive: Document Enumerate() is stub - ResourcePackageBuilder: Document AddDirectory() is stub - ImportSettings: Document LoadFromJSON/SaveToJSON are stubs - TextureImportSettings/MeshImportSettings: Document JSON methods are stubs - TextureLoader/MeshLoader/MaterialLoader/ShaderLoader/AudioLoader: Document GetDefaultSettings() returns nullptr - AudioLoader: Document ParseWAVData() is stub, Load() doesn't parse WAV headers - ShaderLoader: Document DetectShaderType/ParseShaderSource are stubs - MaterialLoader: Document ParseMaterialData() is stub - Texture: Document Create() mipLevels=0 behavior, GenerateMipmaps() returns false - Mesh: Document MeshLoader::Load() is example only - IResourceLoader: Document GetDefaultSettings() returns nullptr for all loaders
47 lines
1.1 KiB
Markdown
47 lines
1.1 KiB
Markdown
# TaskGroup::Wait
|
||
|
||
```cpp
|
||
void Wait()
|
||
```
|
||
|
||
**注意:** 此方法当前为**空实现/桩代码**,不执行任何操作。
|
||
|
||
阻塞当前线程,等待任务组中所有任务完成。
|
||
|
||
**参数:** 无
|
||
|
||
**返回:** 无
|
||
|
||
**复杂度:** N/A(空实现)
|
||
|
||
**当前状态:** 此方法为空实现,不执行任何操作。由于 `m_pendingCount` 计数器未正确更新,此方法永远无法正常运作。
|
||
|
||
**建议:** 使用 `WaitFor()` 代替以避免永久阻塞。
|
||
|
||
**示例:**
|
||
|
||
```cpp
|
||
TaskGroup* group = TaskSystem::Get().CreateTaskGroup();
|
||
|
||
for (int i = 0; i < 10; ++i) {
|
||
group->AddTask([i]() {
|
||
printf("Task %d running\n", i);
|
||
});
|
||
}
|
||
|
||
printf("Waiting for all tasks...\n");
|
||
// 注意:Wait() 为空实现,建议使用 WaitFor()
|
||
if (group->WaitFor(std::chrono::seconds(5))) {
|
||
printf("All tasks completed within 5 seconds\n");
|
||
} else {
|
||
printf("Timeout! Tasks may not have completed\n");
|
||
}
|
||
|
||
TaskSystem::Get().DestroyTaskGroup(group);
|
||
```
|
||
|
||
## 相关文档
|
||
|
||
- [TaskGroup 总览](task-group.md) - 返回类总览
|
||
- [WaitFor](waitfor.md) - 超时等待
|