def __init__(self,action=None,max_threads=5,start=False,mp=False):
import threading
if mp==True:
import multiprocessing
self._myThread = multiprocessing.Process
self._myQueue = multiprocessing.Queue
else:
import Queue
self._myThread = threading.Thread
self._myQueue = Queue.Queue
self._action = action
self._max_threads = max_threads
self._threads = []
self._pending = []
self._stop = threading.Event()
self._lock = threading.Lock()
self._locked = partial(locked,_lock=self._lock)
self._started = start
self._queue = self._myQueue()
评论列表
文章目录