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 - 2001, 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.810 2002/10/25 18:19:35 mast Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.811 2002/10/27 17:35:27 mast Exp $";      // The argument cache. Used by the image cache.   ArgCache argcache;      // Some headerfiles   #define IN_ROXEN   #include <roxen.h>   #include <config.h>   #include <module.h>   #include <variables.h>
Roxen.git/server/base_server/roxen.pike:516: Inside #if defined(THREADS)
   array buffer=allocate(8);    int r_ptr, w_ptr;       int size()    {    return w_ptr - r_ptr;    }       mixed read()    { -  while(!(w_ptr - r_ptr)) +  while(!(w_ptr - r_ptr)) {    // Make a MutexKey for wait() to please 7.3. This will of course    // not fix the race, but we ignore that. See the discussion -  // above. -  r_cond::wait (Thread.Mutex()->lock()); +  // above. (Must have an extra ref to the mutex since the +  // MutexKey doesn't keep one.) +  Thread.Mutex m = Thread.Mutex(); +  r_cond::wait (m->lock()); +  }    mixed tmp = buffer[r_ptr];    buffer[r_ptr++] = 0; // Throw away any references.    return tmp;    }       mixed tryread()    {    if (!(w_ptr - r_ptr)) return ([])[0];    mixed tmp = buffer[r_ptr];    buffer[r_ptr++] = 0; // Throw away any references.
Roxen.git/server/base_server/roxen.pike:617: Inside #if defined(THREADS)
   return;    }   #ifdef DEBUG    else if (h != 1)    error ("Unknown message in handle_queue: %O\n", h);   #endif    else {    num_hold_messages--;    THREAD_WERR("Handle thread [" + id + "] put on hold");    threads_on_hold++; -  if (Thread.Condition cond = hold_wakeup_cond) +  if (Thread.Condition cond = hold_wakeup_cond) {    // Make a MutexKey for wait() to please 7.3. This will of    // course not fix the race, but we ignore that. See the -  // comment at the declaration of hold_wakeup_cond. -  cond->wait (Thread.Mutex()->lock()); +  // comment at the declaration of hold_wakeup_cond. (Must +  // have an extra ref to the mutex since the MutexKey +  // doesn't keep one.) +  Thread.Mutex m = Thread.Mutex(); +  cond->wait (m->lock()); +  }    threads_on_hold--;    THREAD_WERR("Handle thread [" + id + "] released");    }    } while(1);    }) {    if (h = catch {    report_error(/*LOCALE("", "Uncaught error in handler thread: %s"    "Client will not get any response from Roxen.\n"),*/    describe_backtrace(q));    if (q = catch {h = 0;}) {