Merge 26ced53e4d
into f9e990d0f0
This commit is contained in:
commit
fae0e3e3c6
4 changed files with 11 additions and 5 deletions
|
@ -49,6 +49,8 @@ protected:
|
||||||
std::atomic<uint32_t> m_index = {};
|
std::atomic<uint32_t> m_index = {};
|
||||||
uint64_t m_hashCount[2] = {};
|
uint64_t m_hashCount[2] = {};
|
||||||
uint64_t m_timestamp[2] = {};
|
uint64_t m_timestamp[2] = {};
|
||||||
|
|
||||||
|
uint64_t m_count = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,9 @@
|
||||||
#define XMRIG_WORKER_H
|
#define XMRIG_WORKER_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <atomic>
|
||||||
|
|
||||||
|
|
||||||
#include "backend/common/interfaces/IWorker.h"
|
#include "backend/common/interfaces/IWorker.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -38,8 +41,6 @@ protected:
|
||||||
inline size_t id() const override { return m_id; }
|
inline size_t id() const override { return m_id; }
|
||||||
inline uint32_t node() const { return m_node; }
|
inline uint32_t node() const { return m_node; }
|
||||||
|
|
||||||
uint64_t m_count = 0;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const int64_t m_affinity;
|
const int64_t m_affinity;
|
||||||
const size_t m_id;
|
const size_t m_id;
|
||||||
|
|
|
@ -232,8 +232,8 @@ bool xmrig::CpuWorker<N>::selfTest()
|
||||||
template<size_t N>
|
template<size_t N>
|
||||||
void xmrig::CpuWorker<N>::hashrateData(uint64_t &hashCount, uint64_t &, uint64_t &rawHashes) const
|
void xmrig::CpuWorker<N>::hashrateData(uint64_t &hashCount, uint64_t &, uint64_t &rawHashes) const
|
||||||
{
|
{
|
||||||
hashCount = m_count;
|
hashCount = m_count.load(std::memory_order_relaxed);
|
||||||
rawHashes = m_count;
|
rawHashes = hashCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -351,7 +351,8 @@ void xmrig::CpuWorker<N>::start()
|
||||||
JobResults::submit(job, current_job_nonces[i], m_hash + (i * 32), job.hasMinerSignature() ? miner_signature_saved : nullptr);
|
JobResults::submit(job, current_job_nonces[i], m_hash + (i * 32), job.hasMinerSignature() ? miner_signature_saved : nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_count += N;
|
|
||||||
|
m_count.fetch_add(N, std::memory_order_relaxed);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_yield) {
|
if (m_yield) {
|
||||||
|
|
|
@ -107,6 +107,8 @@ private:
|
||||||
# ifdef XMRIG_FEATURE_BENCHMARK
|
# ifdef XMRIG_FEATURE_BENCHMARK
|
||||||
uint32_t m_benchSize = 0;
|
uint32_t m_benchSize = 0;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
std::atomic<uint64_t> m_count = {0};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue