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

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

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:
    539
    Bob Alistar
    Dec 4, 2003
  2. Antoon Pardon
    Replies:
    0
    Views:
    445
    Antoon Pardon
    Mar 15, 2005
  3. Replies:
    0
    Views:
    662
  4. Replies:
    0
    Views:
    436
  5. Replies:
    0
    Views:
    649
  6. sathya

    K&r chapter-1; exc-17

    sathya, Nov 26, 2004, in forum: C Programming
    Replies:
    35
    Views:
    1,243
    Merrill & Michele
    Nov 30, 2004
  7. Klaus Ahrens
    Replies:
    6
    Views:
    563
    Alf P. Steinbach
    Nov 29, 2005
  8. nepaul
    Replies:
    2
    Views:
    520
    Peter Otten
    Aug 17, 2012
Loading...