Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __worker_pool_stop(self):
for p in self.__worker_pool:
self.__task_queue.put(Bleichenbacher.__POISON_PILL)
p.terminate()
p.join(2)
self.__logger.info("Stopped all worker threads in the pool")
self.__worker_pool_running = False