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.987 2008/09/22 12:07:59 mast Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.988 2008/09/22 15:18:02 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:604: Inside #if defined(THREADS)
   buffer[w_ptr++]=v;    r_cond::signal();    }   }      #ifndef NO_SLOW_REQ_BT   // This is a system to dump all threads whenever a request takes   // longer than a configurable timeout.      protected Pike.Backend slow_req_monitor; // Set iff slow req bt is enabled. - protected int slow_req_timeout; + protected float slow_req_timeout;      protected void slow_req_monitor_thread (Pike.Backend my_monitor)   {    // my_monitor is just a safeguard to ensure we don't get multiple    // monitor threads.    while (slow_req_monitor == my_monitor)    slow_req_monitor (3600);   }    - void set_slow_req_timeout (int secs) + void set_slow_req_timeout (float secs)   {   #ifdef DEBUG    if (secs < 0) error ("Invalid timeout.\n");   #endif       Pike.Backend monitor = slow_req_monitor;    slow_req_timeout = secs;    -  if (secs && monitor) { +  if (secs > 0.0 && monitor) {    // Just a change of timeout - nothing more to do.    }    -  else if (secs) { // Start. +  else if (secs > 0.0) { // Start.    monitor = slow_req_monitor = Pike.SmallBackend();    Thread.thread_create (slow_req_monitor_thread, monitor);    monitor->call_out (lambda () {}, 0); // Safeguard if there's a race.    }       else if (monitor) { // Stop.    slow_req_monitor = 0;    monitor->call_out (lambda () {}, 0); // To wake up the thread.    }   }    - protected void dump_slow_req (Thread.Thread thread, int timeout) + protected void dump_slow_req (Thread.Thread thread, float timeout)   { -  report_debug ("### Thread 0x%x has been busy for more than %d 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:5338:    array(string) splitdir = roxen_path ("$LOGFILE") / "/";    cdt_filename = splitdir[-1];    cdt_directory = splitdir[..sizeof (splitdir) - 2] * "/";    if (has_suffix (cdt_filename, ".1"))    cdt_filename = cdt_filename[..sizeof (cdt_filename) - 3];    cdt_filename += ".dump_threads";    cdt_changed (getvar ("dump_threads_by_file"));    }      #ifndef NO_SLOW_REQ_BT -  if (int timeout = query ("slow_req_bt")) -  if (timeout > 0) +  if (float timeout = query ("slow_req_bt")) +  if (timeout > 0.0)    set_slow_req_timeout (timeout);   #endif      #ifdef ROXEN_DEBUG_MEMORY_TRACE    restart_roxen_debug_memory_trace();   #endif      #ifndef __NT__    restart_if_stuck( 0 );   #endif