Simple thread pool class.