Fixed cpu affinity for single thread
This commit is contained in:
parent
2d08b5ed74
commit
566a9f57ec
1 changed files with 2 additions and 1 deletions
|
@ -33,13 +33,14 @@
|
|||
|
||||
Worker::Worker(Handle *handle) :
|
||||
m_id(handle->threadId()),
|
||||
m_affinedCpu(0),
|
||||
m_threads(handle->threads()),
|
||||
m_hashCount(0),
|
||||
m_timestamp(0),
|
||||
m_count(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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue