Roxen.git / server / base_server / roxen.pike

version» Context lines:

Roxen.git/server/base_server/roxen.pike:3804: Inside #if undefined(__NT__)
   t = alarm(20); // Restart the timeout timer.    foreach(call_out_info(), array info) {    report_debug(" %4d seconds: %O(%{%O, %})\n",    info[0], info[2], info[3]);    }    })    master()->handle_error(err);    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:3829: 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 ""