MODE-2353 - Added logic to wait for all of threads to return.