Mercurial > cpython-lru_cache-weakref
diff Doc/lib/libthread.tex @ 2576:f47bc5554418 legacy-trunk
mass changes; fix titles; add examples; correct typos; clarifications;
unified style; etc.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Fri, 17 Mar 1995 16:07:09 +0000 |
| parents | 815dfaa6a778 |
| children | 9b7e6d9a528d |
line wrap: on
line diff
--- a/Doc/lib/libthread.tex Fri Mar 17 16:03:11 1995 +0000 +++ b/Doc/lib/libthread.tex Fri Mar 17 16:07:09 1995 +0000 @@ -26,18 +26,22 @@ 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 @@ \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}
