def __init__(self, thread_class, opt):
self.opt = opt<EOL>self.tasks = TaskQueue()<EOL>self.processed_tasks = <NUM_LIT:0><EOL>self.thread_class = thread_class<EOL>self.workers = []<EOL>for i in range(opt.num_threads):<EOL><INDENT>self.workers.append(thread_class(self))<EOL><DEDENT>
Constructor of ThreadPool.
           Create workers and pool will automatically inherit all methods from
           thread_class by redirecting calls through __getattribute__().