MCPcopy Create free account
hub / github.com/3rdparty/libprocess / id_function

Function id_function

src/openssl.cpp:234–244  ·  view source on GitHub ↗

OpenSSL callback that returns the current thread ID, necessary for OpenSSL threading.

Source from the content-addressed store, hash-verified

232// OpenSSL callback that returns the current thread ID, necessary for
233// OpenSSL threading.
234unsigned long id_function()
235{
236 static_assert(sizeof(std::thread::id) == sizeof(unsigned long),
237 "sizeof(std::thread::id) must be equal to sizeof(unsigned long)"
238 " for std::thread::id to be used as a function for determining "
239 "a thread id");
240
241 // We use the std::thread id and convert it to an unsigned long.
242 const std::thread::id id = std::this_thread::get_id();
243 return *reinterpret_cast<const unsigned long*>(&id);
244}
245
246
247// OpenSSL callback for creating new dynamic "locks", abstracted by

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected