PyThreadState_SetAsyncExc (nThreadId ??????, exc);

Karl H. no at spam.com
Thu Dec 14 11:15:23 EST 2006


iwl wrote:
> what is the nThreadId-Parameter of PyThreadState_SetAsyncExc?
> 
> I try to implement a Terminate-Button in my C-Prog for my
> embedded Python, but its hard to find an example how to
> stop an interpreter running in an thread.
> 
> I found no other Python C-App-Func returning such a parameter.
> 

Use the "thread_id" member of the PyThreadState object:

PyThreadState *tstate;

PyThreadState_SetAsyncExc(tstate->thread_id,exc);

-Karl



More information about the Python-list mailing list