You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-cvs@httpd.apache.org by gr...@apache.org on 2004/05/28 20:54:58 UTC

cvs commit: httpd-test/specweb99/specweb99-2.0 mod_specweb99.c

gregames    2004/05/28 11:54:58

  Modified:    specweb99/specweb99-2.0 mod_specweb99.c
  Log:
  work around for a seg fault running a threaded MPM on an SMP box.
  
  Revision  Changes    Path
  1.33      +17 -0     httpd-test/specweb99/specweb99-2.0/mod_specweb99.c
  
  Index: mod_specweb99.c
  ===================================================================
  RCS file: /home/cvs/httpd-test/specweb99/specweb99-2.0/mod_specweb99.c,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -d -b -u -r1.32 -r1.33
  --- mod_specweb99.c	8 Feb 2004 17:10:06 -0000	1.32
  +++ mod_specweb99.c	28 May 2004 18:54:58 -0000	1.33
  @@ -910,6 +910,9 @@
       apr_int16_t userindex, adindex, expired = 0;
       apr_uint32_t userdemographics, combineddemographics; /* it's a bitmap */
       apr_uint16_t ad_weight;
  +    apr_time_t sleep_time = 50000; /* initial sleep time (microseconds) if
  +                                    * getCADfile is running on another thread
  +                                    */
   
       /*
        * XXX Again, ap_document_root is deprecated. I should probably find the
  @@ -956,6 +959,20 @@
       userdemographics = _my->up[userindex];
   
       adindex = (last_ad + 1) % 360;
  +     
  +    while (!_my->cad) {
  +        /* we are probably running threaded on a SMP and another thread is
  +         * in getCADfile.  Hang out for a while rather than seg fault.
  +         * Parsing the cadfile & upfile into shared memory at the end of
  +         * command/Reset is better long term.
  +         */
  +        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
  +                      "do_cadget: sleeping for %.2f seconds", 
  +                      (double)sleep_time/1000000);
  +        apr_sleep(sleep_time);
  +        sleep_time += sleep_time;
  +    }
  +
       /*
        * Do For Each Ad in Custom.Ads starting where Ad_index == Ad_id
        */