httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject cvs commit: httpd-2.0/server/mpm/experimental/leader leader.c
Date Fri, 19 Apr 2002 08:02:00 GMT
brianp      02/04/19 01:02:00

  Modified:    server/mpm/experimental/leader leader.c
  Log:
  Some code transformations to improve the generated assembly
  code within the critical region inside the spin locks.  (Shortening
  this code path reduces the probability that we'll have to spin.)
  
  Revision  Changes    Path
  1.11      +4 -5      httpd-2.0/server/mpm/experimental/leader/leader.c
  
  Index: leader.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/experimental/leader/leader.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- leader.c	19 Apr 2002 06:33:08 -0000	1.10
  +++ leader.c	19 Apr 2002 08:02:00 -0000	1.11
  @@ -247,11 +247,11 @@
   /* Structure used to wake up an idle worker thread
    */
   struct worker_wakeup_info {
  -    apr_thread_cond_t *cond;
  -    apr_thread_mutex_t *mutex;
       apr_uint32_t next; /* index into worker_wakeups array,
                           * used to build a linked list
                           */
  +    apr_thread_cond_t *cond;
  +    apr_thread_mutex_t *mutex;
   };
   
   static worker_wakeup_info *worker_wakeup_create(apr_pool_t *pool)
  @@ -349,9 +349,8 @@
           }
           else {
               worker_wakeup_info *wakeup = worker_wakeups[first];
  -            apr_uint32_t new_state = state & ~STACK_FIRST;
  -            new_state |= wakeup->next;
  -            if (apr_atomic_cas(&(stack->state), new_state, state) != state) {
  +            if (apr_atomic_cas(&(stack->state), (state ^ first) | wakeup->next,
  +                               state) != state) {
                   continue;
               }
               else {
  
  
  

Mime
View raw message