':param core_threads: maximum number of persistent threads in the pool
:param max_threads: maximum number of total threads in the pool
:param thread_class: callable that creates a Thread object
:param keepalive: seconds to keep non-core worker threads waiting
for new tasks'

def __init__(self, core_threads=0, max_threads=20, keepalive=1):

    self.core_threads = core_threads
    self.max_threads = max(max_threads, core_threads, 1)
    self.keepalive = keepalive
    self._queue = Queue()
    self._threads_lock = Lock()
    self._threads = set()
    self._shutdown = False
    _threadpools.add(ref(self))
    logger.info('Started    thread    pool    with    %d    core    threads    and    %s    maximum    threads', core_threads, (max_threads or 'unlimited'))
