pike.git / src / module.c

version» Context lines:

pike.git/src/module.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: module.c,v 1.56 2008/08/05 21:10:17 mast Exp $ + || $Id: module.c,v 1.57 2008/08/05 21:23:46 mast Exp $   */      #include "global.h"   #include "module.h"   #include "pike_macros.h"   #include "pike_error.h"   #include "builtin_functions.h"   #include "main.h"   #include "svalue.h"   #include "interpret.h"
pike.git/src/module.c:141: Inside #if defined(DO_PIKE_CLEANUP) and #if defined(WITH_FACETS)
  #ifdef WITH_FACETS    exit_facetgroup();   #endif    cleanup_program();    cleanup_compiler();    cleanup_error();    exit_backend();    cleanup_gc();    cleanup_pike_types();    + #ifdef PIKE_THREADS    /* This zaps Pike_interpreter.thread_state among other things, so    * THREADS_ALLOW/DISALLOW are NOPs beyond this point. */    th_cleanup(); -  + #endif       exit_pike_security();    free_svalue(& throw_value);    mark_free_svalue (&throw_value);       do_gc(NULL, 1);       if (exit_with_cleanup)    {    int leak_found = 0;    - #ifdef _REENTRANT + #ifdef PIKE_THREADS    if(count_pike_threads())    {    fprintf(stderr,"Byte counting aborted, because all threads have not exited properly.\n");    exit_with_cleanup = 0;    return;    }   #endif      #ifdef DEBUG_MALLOC    search_all_memheaders_for_references();
pike.git/src/module.c:430:      void exit_modules(void)   {    JMP_BUF recovery;    volatile int e;      #ifdef DO_PIKE_CLEANUP    size_t count;       if (exit_with_cleanup) { -  /* Destruct all remaining objects while we have a proper execution -  * environment. The downside is that the leak report below will -  * always report destructed objects. We use the gc in a special mode -  * for this to get a reasonably sane destruct order. */ +  /* Kill the threads and destruct all remaining objects while we +  * have a proper execution environment. The downside is that the +  * leak report below will always report destructed objects. We use +  * the gc in a special mode for this to get a reasonably sane +  * destruct order. */ + #ifdef PIKE_THREADS +  cleanup_all_other_threads(); + #endif    gc_destruct_everything = 1;    count = do_gc (NULL, 1);    while (count) {    size_t new_count = do_gc (NULL, 1);    if (new_count >= count) {    fprintf (stderr, "Some destroy function is creating new objects "    "during final cleanup - can't exit cleanly.\n");    break;    }    count = new_count;