Branch: Tag:

2008-05-23

2008-05-23 12:33:54 by Martin Stjernholm <mast@lysator.liu.se>

Fixed too early call to pike_do_exit which could make the cleanup-on-exit
report show false alarms when a multithreaded program exits.

Rev: src/pike_error.h:1.44
Rev: src/threads.c:1.256

2:   || 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"
921:    {    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;
935:    /* 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);
984:    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);