Commit 9d9b9b26 authored by Fred Drake's avatar Fred Drake

Some general cleanup of the threading module documentation, including

fixing the reference to Thread.getDeamon() (should be isDaemon()).

This closes SF bug #429070.
parent c4873562
...@@ -68,9 +68,9 @@ The \method{acquire()} method blocks if necessary until it can return ...@@ -68,9 +68,9 @@ The \method{acquire()} method blocks if necessary until it can return
without making the counter negative. without making the counter negative.
\end{funcdesc} \end{funcdesc}
\begin{classdesc}{Thread}{} \begin{classdesc*}{Thread}{}
A class that represents a thread of control. This class can be safely subclassed in a limited fashion. A class that represents a thread of control. This class can be safely subclassed in a limited fashion.
\end{classdesc} \end{classdesc*}
Detailed interfaces for the objects are documented below. Detailed interfaces for the objects are documented below.
...@@ -444,7 +444,7 @@ A thread can be flagged as a ``daemon thread''. The significance ...@@ -444,7 +444,7 @@ A thread can be flagged as a ``daemon thread''. The significance
of this flag is that the entire Python program exits when only of this flag is that the entire Python program exits when only
daemon threads are left. The initial value is inherited from the daemon threads are left. The initial value is inherited from the
creating thread. The flag can be set with the \method{setDaemon()} creating thread. The flag can be set with the \method{setDaemon()}
method and retrieved with the \method{getDaemon()} method. method and retrieved with the \method{isDaemon()} method.
There is a ``main thread'' object; this corresponds to the There is a ``main thread'' object; this corresponds to the
initial thread of control in the Python program. It is not a initial thread of control in the Python program. It is not a
...@@ -465,32 +465,28 @@ threads. ...@@ -465,32 +465,28 @@ threads.
This constructor should always be called with keyword This constructor should always be called with keyword
arguments. Arguments are: arguments. Arguments are:
\var{group} \var{group} should be \code{None}; reserved for future extension when
Should be \code{None}; reserved for future extension when a a \class{ThreadGroup} class is implemented.
\class{ThreadGroup} class is implemented.
\var{target} \var{target} is the callable object to be invoked by the
Callable object to be invoked by the \method{run()} method. \method{run()} method. Defaults to \code{None}, meaning nothing is
Defaults to \code{None}, meaning nothing is called. called.
\var{name} \var{name} is the thread name. By default, a unique name is
The thread name. By default, a unique name is constructed of the form constructed of the form ``Thread-\var{N}'' where \var{N} is a small
``Thread-\var{N}'' where \var{N} is a small decimal number. decimal number.
\var{args} \var{args} is the argument tuple for the target invocation. Defaults
Argument tuple for the target invocation. Defaults to \code{()}. to \code{()}.
\var{kwargs} \var{kwargs} is a dictionary of keyword arguments for the target
Keyword argument dictionary for the target invocation. invocation. Defaults to \code{\{\}}.
Defaults to \code{\{\}}.
If the subclass overrides the constructor, it must make sure If the subclass overrides the constructor, it must make sure
to invoke the base class constructor (\code{Thread.__init__()}) to invoke the base class constructor (\code{Thread.__init__()})
before doing anything else to the thread. before doing anything else to the thread.
\end{classdesc} \end{classdesc}
\begin{methoddesc}{start}{} \begin{methoddesc}{start}{}
Start the thread's activity. Start the thread's activity.
...@@ -499,8 +495,6 @@ arranges for the object's \method{run()} method to be invoked in a ...@@ -499,8 +495,6 @@ arranges for the object's \method{run()} method to be invoked in a
separate thread of control. separate thread of control.
\end{methoddesc} \end{methoddesc}
\begin{methoddesc}{run}{} \begin{methoddesc}{run}{}
Method representing the thread's activity. Method representing the thread's activity.
...@@ -511,7 +505,6 @@ arguments taken from the \var{args} and \var{kwargs} arguments, ...@@ -511,7 +505,6 @@ arguments taken from the \var{args} and \var{kwargs} arguments,
respectively. respectively.
\end{methoddesc} \end{methoddesc}
\begin{methoddesc}{join}{\optional{timeout}} \begin{methoddesc}{join}{\optional{timeout}}
Wait until the thread terminates. Wait until the thread terminates.
This blocks the calling thread until the thread whose \method{join()} This blocks the calling thread until the thread whose \method{join()}
...@@ -531,8 +524,6 @@ It is an error to attempt to \method{join()} a thread before it has ...@@ -531,8 +524,6 @@ It is an error to attempt to \method{join()} a thread before it has
been started. been started.
\end{methoddesc} \end{methoddesc}
\begin{methoddesc}{getName}{} \begin{methoddesc}{getName}{}
Return the thread's name. Return the thread's name.
\end{methoddesc} \end{methoddesc}
...@@ -565,4 +556,3 @@ The initial value is inherited from the creating thread. ...@@ -565,4 +556,3 @@ The initial value is inherited from the creating thread.
The entire Python program exits when no active non-daemon The entire Python program exits when no active non-daemon
threads are left. threads are left.
\end{methoddesc} \end{methoddesc}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment