summaryrefslogtreecommitdiffstats
path: root/Doc/api
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2006-08-10 22:45:34 (GMT)
committerTim Peters <tim.peters@gmail.com>2006-08-10 22:45:34 (GMT)
commit4643c2fda1546d6d5b0b33a93ee84218da7ad78b (patch)
tree3b75481e12d7c671950abc4400de3960009662ce /Doc/api
parent789c09d2cd8da14166846f007d53a56585b0d6c3 (diff)
downloadcpython-4643c2fda1546d6d5b0b33a93ee84218da7ad78b.zip
cpython-4643c2fda1546d6d5b0b33a93ee84218da7ad78b.tar.gz
cpython-4643c2fda1546d6d5b0b33a93ee84218da7ad78b.tar.bz2
Followup to bug #1069160.
PyThreadState_SetAsyncExc(): internal correctness changes wrt refcount safety and deadlock avoidance. Also added a basic test case (relying on ctypes) and repaired the docs.
Diffstat (limited to 'Doc/api')
-rw-r--r--Doc/api/init.tex12
1 files changed, 6 insertions, 6 deletions
diff --git a/Doc/api/init.tex b/Doc/api/init.tex
index 9225f69..e380bdb 100644
--- a/Doc/api/init.tex
+++ b/Doc/api/init.tex
@@ -696,15 +696,15 @@ interpreter lock has been created.
\end{cfuncdesc}
\begin{cfuncdesc}{int}{PyThreadState_SetAsyncExc}{long id, PyObject *exc}
- Asynchronously raise an exception in a thread.
+ Asynchronously raise an exception in a thread.
The \var{id} argument is the thread id of the target thread;
\var{exc} is the exception object to be raised.
This function does not steal any references to \var{exc}.
- To prevent naive misuse, you must write your own C extension
- to call this. Must be called with the GIL held.
- Returns the number of thread states modified; if it returns a number
- greater than one, you're in trouble, and you should call it again
- with \var{exc} set to \constant{NULL} to revert the effect.
+ To prevent naive misuse, you must write your own C extension
+ to call this. Must be called with the GIL held.
+ Returns the number of thread states modified; this is normally one, but
+ will be zero if the thread id isn't found. If \var{exc} is
+ \constant{NULL}, the pending exception (if any) for the thread is cleared.
This raises no exceptions.
\versionadded{2.3}
\end{cfuncdesc}