Author: mturk
Date: Wed May  9 11:32:43 2012
New Revision: 1336104

URL: http://svn.apache.org/viewvc?rev=1336104&view=rev
Log:
Use the same logic for subworkers; always increment the shared memory on push 
and then sync the local reference

Modified:
    tomcat/jk/trunk/native/common/jk_lb_worker.c

Modified: tomcat/jk/trunk/native/common/jk_lb_worker.c
URL: 
http://svn.apache.org/viewvc/tomcat/jk/trunk/native/common/jk_lb_worker.c?rev=1336104&r1=1336103&r2=1336104&view=diff
==============================================================================
--- tomcat/jk/trunk/native/common/jk_lb_worker.c (original)
+++ tomcat/jk/trunk/native/common/jk_lb_worker.c Wed May  9 11:32:43 2012
@@ -375,7 +375,7 @@ void jk_lb_push(lb_worker_t *p, int lock
 
     for (i = 0; i < p->num_of_workers; i++) {
         lb_sub_worker_t *w = &p->lb_workers[i];
-        if (w->sequence > w->s->h.sequence) {
+        if (w->sequence != w->s->h.sequence) {
             jk_worker_t *jw = w->worker;
             ajp_worker_t *aw = (ajp_worker_t *)jw->worker_private;
 
@@ -392,14 +392,15 @@ void jk_lb_push(lb_worker_t *p, int lock
             w->s->activation = w->activation;
             w->s->lb_factor = w->lb_factor;
             w->s->lb_mult = w->lb_mult;
-            w->s->h.sequence = w->sequence;
+            w->s->h.sequence++;
+            w->sequence = w->s->h.sequence;
         }
     }
     /* Increment the shared memory sequence number.
      * Our number can be behind the actual value in
      * shared memory.
      */
-    ++p->s->h.sequence;
+    p->s->h.sequence++;
     p->sequence = p->s->h.sequence;
     if (locked == JK_FALSE)
         jk_shm_unlock();



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to