Mercurial > cpython-lru_cache-weakref
diff Doc/api/init.tex @ 39431:de9e1a5dca93 legacy-trunk
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.
| author | Tim Peters <tim.peters@gmail.com> |
|---|---|
| date | Thu, 10 Aug 2006 22:45:34 +0000 |
| parents | e364bc76bdc8 |
| children | 06145fbc7ab9 |
line wrap: on
line diff
--- a/Doc/api/init.tex Thu Aug 10 19:04:00 2006 +0000 +++ b/Doc/api/init.tex Thu Aug 10 22:45:34 2006 +0000 @@ -696,15 +696,15 @@ \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}
