Skip to content

Commit 027f6dd

Browse files
committed
better thread distribution
1 parent 776b6d8 commit 027f6dd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

public/vstdlib/jobthread.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,8 +913,11 @@ class CParallelProcessor
913913

914914
while( i-- )
915915
{
916-
jobs[i] = pThreadPool->QueueCall( this, &CParallelProcessor<ITEM_TYPE, ITEM_PROCESSOR_TYPE>::DoExecute );
916+
jobs[i] = pThreadPool->QueueCall( this, JF_NO_ADD, &CParallelProcessor<ITEM_TYPE, ITEM_PROCESSOR_TYPE>::DoExecute );
917917
jobs[i]->SetDescription( m_szDescription );
918+
jobs[i]->SetServiceThread(i);
919+
jobs[i]->SetFlags(JF_QUEUE);
920+
pThreadPool->AddJob(jobs[i]);
918921
}
919922

920923
// Do jobs alongside the threads

0 commit comments

Comments
 (0)