Allow ThreadPool to be configured with an arbitrary number of threads.