mirror of
https://github.com/oatpp/oatpp.git
synced 2025-04-12 18:50:22 +08:00
Fixed calculation of getThreadSuggestedCpuIndex
This commit is contained in:
parent
8e5f64c916
commit
521291ef7f
@ -33,7 +33,7 @@ namespace oatpp { namespace concurrency {
|
||||
|
||||
v_int32 Thread::getThreadSuggestedCpuIndex(std::thread::id threadId, v_int32 cpuCount) {
|
||||
static std::hash<std::thread::id> hashFunction;
|
||||
static thread_local v_int32 lock = hashFunction(std::this_thread::get_id()) % OATPP_THREAD_DISTRIBUTED_MEM_POOL_SHARDS_COUNT;
|
||||
v_int32 lock = hashFunction(threadId) % OATPP_THREAD_DISTRIBUTED_MEM_POOL_SHARDS_COUNT;
|
||||
return lock % cpuCount;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user