Roxen.git / server / base_server / configuration.pike

version» Context lines:

Roxen.git/server/base_server/configuration.pike:1:   // A vitual server's main configuration   // Copyright © 1996 - 2000, Roxen IS.    - constant cvs_version = "$Id: configuration.pike,v 1.387 2001/04/03 12:37:32 wing Exp $"; + constant cvs_version = "$Id: configuration.pike,v 1.388 2001/04/08 22:01:55 per Exp $";   constant is_configuration = 1;   #include <module.h>   #include <module_constants.h>   #include <roxen.h>   #include <request_trace.h>      inherit "basic_defvar";      mapping enabled_modules = ([]);   mapping(string:array(int)) error_log=([]);
Roxen.git/server/base_server/configuration.pike:852: Inside #if defined(THREADS)
  #ifdef THREADS   // import Thread;      mapping locked = ([]), thread_safe = ([]);      mixed _lock(object|function f)   {    object key;    function|int l;    -  if (functionp(f)) { -  f = function_object(f); -  } +  +  f = Roxen.get_owning_module( f ) || f; +     if (l = locks[f])    {    if (l != -1)    {    // Allow recursive locks.    catch{    //werror("lock %O\n", f);    locked[f]++;    key = l();    };    } else    thread_safe[f]++; -  } else if (f->thread_safe) { +  } else if (objectp(f) && f->thread_safe) {    locks[f]=-1;    thread_safe[f]++;    } else {    if (!locks[f])    {    // Needed to avoid race-condition.    l = Thread.Mutex()->lock;    if (!locks[f]) {    locks[f]=l;    }