Files
XCEngine/docs/api/XCEngine/Threading/Thread/GetCurrentId.md

503 B

Thread::GetCurrentId

获取当前线程标识。

static Id GetCurrentId();

行为说明

当前实现会:

  1. 获取 std::this_thread::get_id()
  2. 通过 std::hash<std::thread::id> 求 hash
  3. 把结果转成 Id

返回值

  • Id - 当前线程的 hash 化标识值。

注意事项

  • 这个值不是 GetId 所用的 native_handle() 转换结果,因此两者不是统一编码。

相关文档