shouldn't we count 'samplesCountDoneFromTerminatedThreads' here? 
and remove threads from 'threads'?