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/start.md
Normal file
37
docs/api/threading/thread/start.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# Thread::Start
|
||||
|
||||
```cpp
|
||||
template<typename Func>
|
||||
void Start(Func&& func, const Containers::String& name = "Thread")
|
||||
```
|
||||
|
||||
启动线程,执行传入的可调用对象。该方法创建一个新的执行线程,立即开始运行。
|
||||
|
||||
**参数:**
|
||||
- `func` - 要在线程中执行的可调用对象(lambda、函数指针、仿函数等)
|
||||
- `name` - 线程名称,用于调试和日志输出,默认值为 "Thread"
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**线程安全:** 该方法不是线程安全的,不应在同一 Thread 对象上并发调用。
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "Threading/Thread.h"
|
||||
|
||||
Thread worker;
|
||||
worker.Start([]() {
|
||||
printf("Worker thread running\n");
|
||||
Thread::Sleep(100);
|
||||
printf("Worker thread done\n");
|
||||
}, "WorkerThread");
|
||||
|
||||
worker.Join();
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [Thread 总览](thread.md) - 返回类总览
|
||||
Reference in New Issue
Block a user