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.965 2007/08/14 13:54:03 grubba Exp $"; + constant cvs_version="$Id$";      //! @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:2748: Inside #if undefined(__NT__)
   };   #endif    report_debug("Trying to dump backlog: \n");    catch {    // Catch for paranoia reasons.    describe_all_threads();    };    low_engage_abs();   }    + //! Called to indicate that the handler threads are alive. + //! + //! Usually called automatically via @[handle()] by @[restart_if_stuck()], + //! but may need to be called by hand when handler threads are intentionally + //! blocked for a longer time (eg via long-lived global mutex locks). + //! + //! Do not call unless you know what you are doing. + void handler_ping() + { +  handlers_alive = time(); + } +    void restart_if_stuck (int force)   //! @note   //! Must be called from the backend thread due to Linux peculiarities.   {    remove_call_out(restart_if_stuck);    if (!(query("abs_engage") || force))    return;    if(!abs_started)    {    abs_started = 1;
Roxen.git/server/base_server/roxen.pike:2773: Inside #if undefined(__NT__)
  // return a[2] == restart_if_stuck; }));    signal(signum("SIGALRM"), engage_abs);    int t = alarm (60*query("abs_timeout")+20);    // werror("alarm: %d seconds left, set to %d\n", t, 60*query("abs_timeout")+20);    if ((time(1) - handlers_alive) > 60*query("abs_timeout")) {    // The handler installed below hasn't run.    report_debug("**** %s: ABS: Handlers are dead!\n",    ctime(time()) - "\n");    engage_abs(0);    } -  handle(lambda() { handlers_alive = time(); }); +  handle(handler_ping);   }   #endif      #if constant(ROXEN_MYSQL_SUPPORTS_UNICODE)   // NOTE: We need to mark binary data as binary in case   // the Mysql character_set_connection has been   // set to anything other than "latin1".   #define MYSQL__BINARY "_binary"   #else   #define MYSQL__BINARY ""