From: Antoine Pitrou Date: Tue, 10 Apr 2012 20:51:26 +0000 (+0200) Subject: Merge X-Git-Tag: v3.3.0a3~263 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=61d85bab4d128a687bcf03704a861578caed8239;p=thirdparty%2FPython%2Fcpython.git Merge --- 61d85bab4d128a687bcf03704a861578caed8239 diff --cc Doc/library/threading.rst index d2727319dca7,8571104c4c7e..93b5e11f4c14 --- a/Doc/library/threading.rst +++ b/Doc/library/threading.rst @@@ -218,30 -218,31 +218,32 @@@ Thread Object This class represents an activity that is run in a separate thread of control. There are two ways to specify the activity: by passing a callable object to the - constructor, or by overriding the :meth:`run` method in a subclass. No other - methods (except for the constructor) should be overridden in a subclass. In - other words, *only* override the :meth:`__init__` and :meth:`run` methods of - this class. + constructor, or by overriding the :meth:`~Thread.run` method in a subclass. + No other methods (except for the constructor) should be overridden in a + subclass. In other words, *only* override the :meth:`~Thread.__init__` + and :meth:`~Thread.run` methods of this class. Once a thread object is created, its activity must be started by calling the - thread's :meth:`start` method. This invokes the :meth:`run` method in a - separate thread of control. + thread's :meth:`~Thread.start` method. This invokes the :meth:`~Thread.run` + method in a separate thread of control. Once the thread's activity is started, the thread is considered 'alive'. It - stops being alive when its :meth:`run` method terminates -- either normally, or - by raising an unhandled exception. The :meth:`is_alive` method tests whether the - thread is alive. + stops being alive when its :meth:`~Thread.run` method terminates -- either + normally, or by raising an unhandled exception. The :meth:`~Thread.is_alive` + method tests whether the thread is alive. - Other threads can call a thread's :meth:`join` method. This blocks the calling - thread until the thread whose :meth:`join` method is called is terminated. + Other threads can call a thread's :meth:`~Thread.join` method. This blocks + the calling thread until the thread whose :meth:`~Thread.join` method is + called is terminated. A thread has a name. The name can be passed to the constructor, and read or - changed through the :attr:`name` attribute. + changed through the :attr:`~Thread.name` attribute. -A thread can be flagged as a "daemon thread". The significance of this flag -is that the entire Python program exits when only daemon threads are left. -The initial value is inherited from the creating thread. The flag can be -set through the :attr:`~Thread.daemon` property. +A thread can be flagged as a "daemon thread". The significance of this flag is +that the entire Python program exits when only daemon threads are left. The +initial value is inherited from the creating thread. The flag can be set - through the :attr:`daemon` property or the *daemon* constructor argument. ++through the :attr:`~Thread.daemon` property or the *daemon* constructor ++argument. There is a "main thread" object; this corresponds to the initial thread of control in the Python program. It is not a daemon thread. @@@ -250,12 -251,11 +252,12 @@@ There is the possibility that "dummy th thread objects corresponding to "alien threads", which are threads of control started outside the threading module, such as directly from C code. Dummy thread objects have limited functionality; they are always considered alive and - daemonic, and cannot be :meth:`join`\ ed. They are never deleted, since it is - impossible to detect the termination of alien threads. + daemonic, and cannot be :meth:`~Thread.join`\ ed. They are never deleted, + since it is impossible to detect the termination of alien threads. -.. class:: Thread(group=None, target=None, name=None, args=(), kwargs={}) +.. class:: Thread(group=None, target=None, name=None, args=(), kwargs={}, + verbose=None, *, daemon=None) This constructor should always be called with keyword arguments. Arguments are: