[Python-checkins] python/dist/src/Include pystate.h,2.24,2.25

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Sat, 28 Jun 2003 14:53:54 -0700


Update of /cvsroot/python/python/dist/src/Include
In directory sc8-pr-cvs1:/tmp/cvs-serv29907/include

Modified Files:
	pystate.h 
Log Message:
Add PyThreadState_SetAsyncExc(long, PyObject *).

A new API (only accessible from C) to interrupt a thread by sending it
an exception.  This is not always effective, but might help some people.
Requested by Just van Rossum and Alex Martelli.  It is intentional
that you have to write your own C extension to call it from Python.

Docs will have to wait.


Index: pystate.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/pystate.h,v
retrieving revision 2.24
retrieving revision 2.25
diff -C2 -d -r2.24 -r2.25
*** pystate.h	19 Apr 2003 15:41:45 -0000	2.24
--- pystate.h	28 Jun 2003 21:53:52 -0000	2.25
***************
*** 75,78 ****
--- 75,81 ----
      int gilstate_counter;
  
+     PyObject *async_exc; /* Asynchronous exception to raise */
+     long thread_id; /* Thread id where this tstate was created */
+ 
      /* XXX signal handlers should also be here */
  
***************
*** 94,97 ****
--- 97,101 ----
  PyAPI_FUNC(PyThreadState *) PyThreadState_Swap(PyThreadState *);
  PyAPI_FUNC(PyObject *) PyThreadState_GetDict(void);
+ PyAPI_FUNC(int) PyThreadState_SetAsyncExc(long, PyObject *);