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

Discussion in 'Python' started by iwl, Dec 14, 2006.

  1. iwl

    iwl Guest

    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.
     
    iwl, Dec 14, 2006
    #1
    1. Advertising

  2. iwl

    Karl H. Guest

    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
     
    Karl H., Dec 14, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bob Alistar
    Replies:
    0
    Views:
    473
    Bob Alistar
    Dec 4, 2003
  2. Antoon Pardon
    Replies:
    0
    Views:
    351
    Antoon Pardon
    Mar 15, 2005
  3. sathya

    K&r chapter-1; exc-17

    sathya, Nov 26, 2004, in forum: C Programming
    Replies:
    35
    Views:
    982
    Merrill & Michele
    Nov 30, 2004
  4. Klaus Ahrens
    Replies:
    6
    Views:
    393
    Alf P. Steinbach
    Nov 29, 2005
  5. nepaul
    Replies:
    2
    Views:
    289
    Peter Otten
    Aug 17, 2012
Loading...

Share This Page