OpenSSL callback that returns the current thread ID, necessary for OpenSSL threading.
| 232 | // OpenSSL callback that returns the current thread ID, necessary for |
| 233 | // OpenSSL threading. |
| 234 | unsigned 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 |
nothing calls this directly
no outgoing calls
no test coverage detected