Roxen.git / server / base_server / roxen.pike

version» Context lines:

Roxen.git/server/base_server/roxen.pike:1:   // This file is part of Roxen WebServer.   // Copyright © 1996 - 2004, Roxen IS.   //   // The Roxen WebServer main program.   //   // Per Hedbor, Henrik Grubbström, Pontus Hagland, David Hedbor and others.   // ABS and suicide systems contributed freely by Francesco Chemolli    - constant cvs_version="$Id: roxen.pike,v 1.989 2008/09/25 20:40:14 mast Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.990 2008/09/25 21:38:11 mast Exp $";      //! @appears roxen   //!   //! The Roxen WebServer main program.      // The argument cache. Used by the image cache.   ArgCache argcache;      // Some headerfiles   #define IN_ROXEN
Roxen.git/server/base_server/roxen.pike:648: Inside #if defined(THREADS) and #if undefined(NO_SLOW_REQ_BT)
   if (query ("slow_req_bt_timeout") < 0) error ("Invalid timeout.\n");   #endif    slow_req_timeout = query ("slow_req_bt_timeout");   }      protected void dump_slow_req (Thread.Thread thread, float timeout)   {    int count = query ("slow_req_bt_count");    if (count > 0) set ("slow_req_bt_count", count - 1);    -  report_debug ("### Thread 0x%x has been busy for more than %g seconds.\n", +  report_debug ("###### Thread 0x%x has been busy for more than %g seconds.\n",    thread->id_number(), timeout);    describe_all_threads();   }      #endif // !NO_SLOW_REQ_BT      // // This is easier than when there are no threads.   // // See the discussion below. :-)   //   // // But there is extra functionality below we really want, though,
Roxen.git/server/base_server/roxen.pike:4980:   }      // Dump all threads to the debug log.   void describe_all_threads()   {   #if constant (thread_create)    // Disable all threads to avoid potential locking problems while we    // have the backtraces. It also gives an atomic view of the state.    object threads_disabled = _disable_threads();    -  report_debug("### Describing all Pike threads:\n\n"); +  report_debug("###### Describing all Pike threads:\n>>\n");       array(Thread.Thread) threads = all_threads();       threads = Array.sort_array (    threads,    lambda (Thread.Thread a, Thread.Thread b) {    // Backend thread first, otherwise in id order.    if (a == backend_thread)    return 0;    else if (b == backend_thread)    return 1;    else    return a->id_number() > b->id_number();    });       int i;    for(i=0; i < sizeof(threads); i++) { -  report_debug("### Thread 0x%x%s:\n", +  report_debug(">> ### Thread 0x%x%s:\n",    threads[i]->id_number(),   #ifdef THREADS    threads[i] == backend_thread ? " (backend thread)" : ""   #else    ""   #endif    ); -  report_debug(describe_backtrace(threads[i]->backtrace()) + "\n"); +  report_debug(">> " + +  replace (describe_backtrace (threads[i]->backtrace()), +  "\n", "\n>> ") + +  "\n");    }    -  report_debug ("### Total %d Pike threads\n\n", sizeof (threads)); +  report_debug ("###### Total %d Pike threads\n\n", sizeof (threads));       threads = 0;    threads_disabled = 0;   #else    report_debug("Describing single thread:\n%s\n\n",    describe_backtrace (backtrace()));   #endif      #ifdef DEBUG    report_debug (RoxenDebug.report_leaks());