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:
37
docs/api/threading/thread/join.md
Normal file
37
docs/api/threading/thread/join.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# Thread::Join
|
||||
|
||||
```cpp
|
||||
void Join()
|
||||
```
|
||||
|
||||
等待线程结束并回收其资源。调用线程将被阻塞,直到目标线程完成执行。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**复杂度:** O(n),n 为目标线程的执行时间
|
||||
|
||||
**注意:**
|
||||
- 如果线程已经被分离(Detach)或已经 Join 过,调用此方法将导致未定义行为。
|
||||
- 建议在使用完 Thread 对象后始终调用 Join 或 Detach。
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Thread worker;
|
||||
worker.Start([]() {
|
||||
for (int i = 0; i < 5; ++i) {
|
||||
printf("Working...\n");
|
||||
Thread::Sleep(100);
|
||||
}
|
||||
}, "WorkerThread");
|
||||
|
||||
printf("Main thread waiting...\n");
|
||||
worker.Join();
|
||||
printf("Worker thread finished\n");
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [Thread 总览](thread.md) - 返回类总览
|
||||
Reference in New Issue
Block a user