pike.git / src / threads.c

version» Context lines:

pike.git/src/threads.c:2741:    /* Do this only if exit_thread_obj already has run. */    cleanup_thread_state (th);   }      static int num_pending_interrupts = 0;   static struct callback *thread_interrupt_callback = NULL;      static void check_thread_interrupt(struct callback *foo,    void *UNUSED(bar), void *UNUSED(gazonk))   { +  if (Pike_interpreter.thread_state->flags & THREAD_FLAG_INHIBIT) { +  return; +  }    if (Pike_interpreter.thread_state->flags & THREAD_FLAG_SIGNAL_MASK) {    if (Pike_interpreter.thread_state->flags & THREAD_FLAG_TERM) {    throw_severity = THROW_THREAD_EXIT;    } else {    throw_severity = THROW_ERROR;    }    Pike_interpreter.thread_state->flags &= ~THREAD_FLAG_SIGNAL_MASK;    if (!--num_pending_interrupts) {    remove_callback(foo);    thread_interrupt_callback = NULL;
pike.git/src/threads.c:2779:    *!    *! @note    *! Interrupts are asynchronous, and are currently not queued.    */   static void f_thread_id_interrupt(INT32 args)   {    /* FIXME: The msg argument is not supported yet. */    pop_n_elems(args);       if (!(THIS_THREAD->flags & THREAD_FLAG_SIGNAL_MASK)) { -  THIS_THREAD->flags |= THREAD_FLAG_INTR; +     num_pending_interrupts++;    if (!thread_interrupt_callback) {    thread_interrupt_callback =    add_to_callback(&evaluator_callbacks, check_thread_interrupt, 0, 0);    }    /* FIXME: Actually interrupt the thread. */    } -  +  THIS_THREAD->flags |= THREAD_FLAG_INTR;    push_int(0);   }      static void low_thread_kill (struct thread_state *th)   {    if (!(th->flags & THREAD_FLAG_SIGNAL_MASK)) {    num_pending_interrupts++;    if (!thread_interrupt_callback) {    thread_interrupt_callback =    add_to_callback(&evaluator_callbacks, check_thread_interrupt, 0, 0);