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:
2026-03-19 12:44:08 +08:00
parent e003fe6513
commit 58a83f445a
1012 changed files with 56880 additions and 22 deletions

View File

@@ -0,0 +1,38 @@
# Thread::Detach
```cpp
void Detach()
```
分离线程,使其成为后台线程独立运行。分离后,线程的资源将在其终止时自动释放,调用线程不会被阻塞。
**参数:**
**返回:**
**复杂度:** O(1)
**注意:**
- 分离后的线程无法再被 Join 或进行任何同步操作。
- 确保分离线程的所有资源访问都是线程安全的,因为主线程可能在分离线程结束前退出。
- 如果 Thread 对象在分离线程结束前被销毁,行为取决于具体实现。
**示例:**
```cpp
Thread background;
background.Start([]() {
printf("Background task running\n");
for (int i = 0; i < 3; ++i) {
Thread::Sleep(500);
printf("Background: tick %d\n", i);
}
}, "BackgroundThread");
background.Detach();
printf("Main thread continues immediately\n");
```
## 相关文档
- [Thread 总览](thread.md) - 返回类总览