adaptive_thread_pool.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:Docker-XX-Net 作者: kuanghy 项目源码 文件源码
def __init__(self,
               num_threads,
               sleep=InterruptibleSleep):
    """Constructor for ThreadGate instances.

    Args:
      num_threads: The total number of threads using this gate.
      sleep: Used for dependency injection.
    """
    self.__enabled_count = 1

    self.__lock = threading.Lock()

    self.__thread_semaphore = threading.Semaphore(self.__enabled_count)
    self.__num_threads = num_threads
    self.__backoff_time = 0
    self.__sleep = sleep
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号