def __init__(self, worker_num: int):
        """ThreadPool with battery

        Args:
            worker_num: the number of running threads to do jobs
        """
        self.lock = threading.RLock()
        self.worker_num = worker_num
        self.running_worker_num = 0
        self._thread_pool = ThreadPoolExecutor(max_workers=worker_num)
ThreadPool with battery

        Args:
            worker_num: the number of running threads to do jobs
        
web_console_v2/api/fedlearner_webconsole/composer/thread_reaper.py