Fixed cpu affinity for single thread

This commit is contained in:
BenDr0id 2018-07-17 14:09:39 +02:00
parent 2d08b5ed74
commit 566a9f57ec

View file

@ -33,13 +33,14 @@
Worker::Worker(Handle *handle) : Worker::Worker(Handle *handle) :
m_id(handle->threadId()), m_id(handle->threadId()),
m_affinedCpu(0),
m_threads(handle->threads()), m_threads(handle->threads()),
m_hashCount(0), m_hashCount(0),
m_timestamp(0), m_timestamp(0),
m_count(0), m_count(0),
m_sequence(0) m_sequence(0)
{ {
if (m_threads > 1 && m_threads <= Cpu::threads()) { if (m_threads > 0 && m_threads <= Cpu::threads()) {
m_affinedCpu = Cpu::setThreadAffinity(m_id, handle->affinity()); m_affinedCpu = Cpu::setThreadAffinity(m_id, handle->affinity());
} }