mirror of
https://github.com/transmission/transmission.git
synced 2025-12-20 02:18:42 +00:00
perf: cache the result of thread_current_id() (#4425)
This commit is contained in:
@@ -107,7 +107,8 @@ int cond_wait(void* vcond, void* vlock, struct timeval const* tv)
|
||||
|
||||
unsigned long thread_current_id()
|
||||
{
|
||||
return std::hash<std::thread::id>()(std::this_thread::get_id());
|
||||
thread_local auto const hashed = std::hash<std::thread::id>()(std::this_thread::get_id());
|
||||
return hashed;
|
||||
}
|
||||
|
||||
void initEvthreadsOnce()
|
||||
|
||||
Reference in New Issue
Block a user