Files
XCSDD/docs/api/threading/thread/getcurrentid.md
ssdfasd 58a83f445a 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
2026-03-19 12:44:08 +08:00

659 B

Thread::GetCurrentId

static Id GetCurrentId()

获取当前执行线程的唯一标识符。这是一个静态方法,可以在任何线程上下文中调用。

参数:

返回: Thread::Id - 当前执行线程的唯一标识符

复杂度: O(1)

示例:

Thread worker;
worker.Start([]() {
    printf("Worker thread id: %llu\n", (unsigned long long)Thread::GetCurrentId());
}, "WorkerThread");

printf("Main thread id: %llu\n", (unsigned long long)Thread::GetCurrentId());
worker.Join();

相关文档