MCPcopy Create free account
hub / github.com/apache/arrow / GetThreadId

Function GetThreadId

cpp/src/arrow/util/io_util.cc:2156–2165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2154}
2155
2156uint64_t GetThreadId() {
2157 uint64_t equiv{0};
2158 // std::thread::id is trivially copyable as per C++ spec,
2159 // so type punning as a uint64_t should work
2160 static_assert(sizeof(std::thread::id) <= sizeof(uint64_t),
2161 "std::thread::id can't fit into uint64_t");
2162 const auto tid = std::this_thread::get_id();
2163 memcpy(&equiv, reinterpret_cast<const void*>(&tid), sizeof(tid));
2164 return equiv;
2165}
2166
2167// Returns the current resident set size (physical memory use) measured
2168// in bytes, or zero if the value cannot be determined on this OS.

Callers 2

~CleanupMethod · 0.85
WorkerTaskMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected