summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2008-08-18 22:38:41 (GMT)
committerBenjamin Peterson <benjamin@python.org>2008-08-18 22:38:41 (GMT)
commit8bdd54575fceba2226fb4652538b851c0778c703 (patch)
treed81c27d3ab5fb91f03b168a3aa1a153367819393
parentf0923f521077d3592fb49edded540289686cfd68 (diff)
downloadcpython-8bdd54575fceba2226fb4652538b851c0778c703.zip
cpython-8bdd54575fceba2226fb4652538b851c0778c703.tar.gz
cpython-8bdd54575fceba2226fb4652538b851c0778c703.tar.bz2
Merged revisions 65842 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r65842 | benjamin.peterson | 2008-08-18 17:29:19 -0500 (Mon, 18 Aug 2008) | 1 line update the threading docs to account for recent changes ........
-rw-r--r--Doc/library/threading.rst38
1 files changed, 23 insertions, 15 deletions
diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst
index 9e41412..4269b25 100644
--- a/Doc/library/threading.rst
+++ b/Doc/library/threading.rst
@@ -12,6 +12,14 @@ level :mod:`_thread` module. See also the :mod:`queue` module.
The :mod:`dummy_threading` module is provided for situations where
:mod:`threading` cannot be used because :mod:`_thread` is missing.
+.. note::
+
+ Some name ``camelCase`` names have been converted to their underscored
+ equivalents. Others have been replaced by properties. Using the old methods
+ in 2.6 will trigger a :exc:`DeprecationWarning` when Python is run with the
+ :option:`-3` flag and a full :exc:`DeprecationWarning` in 3.0. The old names
+ will be removed early in the 3.x series.
+
This module defines the following functions and objects:
@@ -543,13 +551,13 @@ 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.
-A thread has a name. The name can be passed to the constructor, set with the
-:meth:`set_name` method, and retrieved with the :meth:`get_name` method.
+A thread has a name. The name can be passed to the constructor, and read or
+changed through the :attr:`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 with
-the :meth:`set_daemon` method and retrieved with the :meth:`is_daemon` method.
+initial value is inherited from the creating thread. The flag can be set
+through the :attr:`daemon` attribute.
There is a "main thread" object; this corresponds to the initial thread of
control in the Python program. It is not a daemon thread.
@@ -629,16 +637,15 @@ impossible to detect the termination of alien threads.
raises the same exception.
-.. method:: Thread.get_name()
-
- Return the thread's name.
+.. method:: Thread.getName()
+ Thread.setName()
+ Old API for :attr:`~Thread.name`.
-.. method:: Thread.set_name(name)
- Set the thread's name.
+.. attribute:: Thread.name
- The name is a string used for identification purposes only. It has no semantics.
+ A string used for identification purposes only. It has no semantics.
Multiple threads may be given the same name. The initial name is set by the
constructor.
@@ -661,15 +668,16 @@ impossible to detect the termination of alien threads.
returns a list of all alive threads.
-.. method:: Thread.is_daemon()
+.. method:: Thread.isDaemon()
+ Thread.setDaemon()
- Return the thread's daemon flag.
+ Old API for :attr:`~Thread.daemon`.
-.. method:: Thread.set_daemon(daemonic)
+.. attribute:: Thread.daemon
- Set the thread's daemon flag to the Boolean value *daemonic*. This must be
- called before :meth:`start` is called, otherwise :exc:`RuntimeError` is raised.
+ The thread's daemon flag. This must be set before :meth:`start` is called,
+ otherwise :exc:`RuntimeError` is raised.
The initial value is inherited from the creating thread.