Added threadpool class definition.