summaryrefslogtreecommitdiffstats
path: root/Doc/libthread.tex
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-03-17 16:07:09 (GMT)
committerGuido van Rossum <guido@python.org>1995-03-17 16:07:09 (GMT)
commit470be14c8aa23a35a1f4d1f1260a66a85d3f3cd9 (patch)
tree4fd0b8eda81e63366598e55362ceac85adafccb4 /Doc/libthread.tex
parent7760cdea81166b7741561043c58dae171811fb2f (diff)
downloadcpython-470be14c8aa23a35a1f4d1f1260a66a85d3f3cd9.zip
cpython-470be14c8aa23a35a1f4d1f1260a66a85d3f3cd9.tar.gz
cpython-470be14c8aa23a35a1f4d1f1260a66a85d3f3cd9.tar.bz2
mass changes; fix titles; add examples; correct typos; clarifications;
unified style; etc.
Diffstat (limited to 'Doc/libthread.tex')
-rw-r--r--Doc/libthread.tex34
1 files changed, 18 insertions, 16 deletions
diff --git a/Doc/libthread.tex b/Doc/libthread.tex
index 7147ebf..bd81d7c 100644
--- a/Doc/libthread.tex
+++ b/Doc/libthread.tex
@@ -26,18 +26,22 @@ terminates with an unhandled exception, a stack trace is printed and
then the thread exits (but other threads continue to run).
\end{funcdesc}
-\begin{funcdesc}{exit_thread}{}
-Exit the current thread silently. Other threads continue to run.
-\strong{Caveat:} code in pending \code{finally} clauses is not executed.
+\begin{funcdesc}{exit}{}
+This is a shorthand for \code{thread.exit_thread()}.
\end{funcdesc}
-\begin{funcdesc}{exit_prog}{status}
-Exit all threads and report the value of the integer argument
-\var{status} as the exit status of the entire program.
-\strong{Caveat:} code in pending \code{finally} clauses, in this thread
-or in other threads, is not executed.
+\begin{funcdesc}{exit_thread}{}
+Raise the \code{SystemExit} exception. When not caught, this will
+cause the thread to exit silently.
\end{funcdesc}
+%\begin{funcdesc}{exit_prog}{status}
+%Exit all threads and report the value of the integer argument
+%\var{status} as the exit status of the entire program.
+%\strong{Caveat:} code in pending \code{finally} clauses, in this thread
+%or in other threads, is not executed.
+%\end{funcdesc}
+
\begin{funcdesc}{allocate_lock}{}
Return a new lock object. Methods of locks are described below. The
lock is initially unlocked.
@@ -82,18 +86,16 @@ thread, 0 if not.
\item
Threads interact strangely with interrupts: the
\code{KeyboardInterrupt} exception will be received by an arbitrary
-thread.
+thread. (When the \code{signal} module is available, interrupts
+always go to the main thread.)
\item
-Calling \code{sys.exit(\var{status})} or executing
-\code{raise SystemExit, \var{status}} is almost equivalent to calling
-\code{thread.exit_prog(\var{status})}, except that the former ways of
-exiting the entire program do honor \code{finally} clauses in the
-current thread (but not in other threads).
+Calling \code{sys.exit()} or raising the \code{SystemExit} is
+equivalent to calling \code{thread.exit_thread()}.
\item
Not all built-in functions that may block waiting for I/O allow other
-threads to run, although the most popular ones (\code{sleep},
-\code{read}, \code{select}) work as expected.
+threads to run. (The most popular ones (\code{sleep}, \code{read},
+\code{select}) work as expected.)
\end{itemize}