Get return values from threads after the inner loop