Extracts a thread pool-creating method as a utility function.