Changing the threads.size() to sizeth - an external variable

It would increase the performance of the loop as there would be no recomputing of size of "threads" using size() function which proves to be costly while computing again and again during the loop guard check.