当前位置:   article > 正文

python 线程类 threading.Thread.run() 方法_python threading.thread.run()

python threading.thread.run()
    def run(self):
        """Method representing the thread's activity. 
        表示线程活动的方法。

        You may override this method in a subclass. The standard run() method
        invokes the callable object passed to the object's constructor as the
        target argument, if any, with sequential and keyword arguments taken
        from the args and kwargs arguments, respectively.

		您可以在子类中重写此方法。 
		标准的run()方法调用传递给对象构造函数的可调用对象作为目标参数(如果有),
		并分别从args和kwargs参数中获取顺序参数和关键字参数。

        """
        try:
            if self._target:
                self._target(*self._args, **self._kwargs)
        finally:
            # Avoid a refcycle if the thread is running a function with
            # an argument that has a member that points to the thread.
            del self._target, self._args, self._kwargs

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/768837
推荐阅读
相关标签
  

闽ICP备14008679号