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

I

iwl

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.
 
K

Karl H.

iwl said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top