add a method to return the current number of threads