def __init__(self, threadcnt): self.networker = BasicRequests() self.thread_count = threadcnt self._tls = threading.local() self._logport = 6666 self._name = 'spider' self._threads = [] self._reporter = None self._worker_count = 0 self._stat = None self._end_mark = 0 self._running_count = 0 #正在执行任务的线程数量. self.locker = threading.RLock() self.job_mask = 'mnf' self.condtion = threading.Condition() self._jobq = None self._no_more_wait_job = False # 这个变量用于通知wait_for_condition函数,不会再有新的任务来了,不要再等了.