Removed non thread safe access to config.

This commit is contained in:
XMRig 2020-11-16 07:58:28 +07:00
parent ee677ef5c9
commit 926871cbe1
No known key found for this signature in database
GPG key ID: 446A53638BE94409
13 changed files with 24 additions and 27 deletions

View file

@ -116,16 +116,17 @@ size_t xmrig::CpuConfig::memPoolSize() const
std::vector<xmrig::CpuLaunchData> xmrig::CpuConfig::get(const Miner *miner, const Algorithm &algorithm, uint32_t benchSize) const
{
std::vector<CpuLaunchData> out;
const CpuThreads &threads = m_threads.get(algorithm);
const auto &threads = m_threads.get(algorithm);
if (threads.isEmpty()) {
return out;
}
out.reserve(threads.count());
const size_t count = threads.count();
out.reserve(count);
for (const CpuThread &thread : threads.data()) {
out.emplace_back(miner, algorithm, *this, thread, benchSize);
for (const auto &thread : threads.data()) {
out.emplace_back(miner, algorithm, *this, thread, benchSize, count);
}
return out;