pike.git / src / threads.c

version» Context lines:

pike.git/src/threads.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: threads.c,v 1.255 2007/10/06 13:10:12 marcus Exp $ + || $Id: threads.c,v 1.256 2008/05/23 12:33:54 mast Exp $   */      #include "global.h"      PMOD_EXPORT int num_threads = 1;   PMOD_EXPORT int threads_disabled = 0;      /* #define PICKY_MUTEX */      #ifdef _REENTRANT
pike.git/src/threads.c:914:       Pike_interpreter.trace_level = default_t_flag;       THREADS_FPRINTF(0, (stderr,"new_thread_func(): Thread %p inited\n",    arg.thread_state));       if(SETJMP(back))    {    if(throw_severity <= THROW_ERROR)    call_handle_error(); -  if(throw_severity == THROW_EXIT) -  { -  pike_do_exit(throw_value.u.integer); -  } +     } else {    INT32 args=arg.args->size;    back.severity=THROW_EXIT;    push_array_items(arg.args);    arg.args=0;    f_call_function(args);       /* copy return value to the arg.thread_state here */    assign_svalue(&arg.thread_state->result, Pike_sp-1);    pop_stack(); -  +  +  throw_severity = THROW_N_A;    }       UNSETJMP(back);       DEBUG_CHECK_THREAD();       if(thread_state->thread_local != NULL) {    free_mapping(thread_state->thread_local);    thread_state->thread_local = NULL;    }
pike.git/src/threads.c:977:    {    remove_callback(threads_evaluator_callback);    threads_evaluator_callback=0;    }      #ifdef INTERNAL_PROFILING    fprintf (stderr, "Thread usage summary:\n");    debug_print_rusage (stderr);   #endif    +  if (throw_severity == THROW_EXIT) +  /* Do this after all thread cleanup to avoid false alarms if using +  * DO_PIKE_CLEANUP. */ +  pike_do_exit (throw_value.u.integer); +     /* FIXME: What about threads_disable? */    mt_unlock_interpreter();    th_exit(0);    /* NOT_REACHED, but removes a warning */    return 0;   }      #ifdef UNIX_THREADS   int num_lwps = 1;   #endif