manoj       99/04/29 13:09:45

  Modified:    pthreads/src/include http_accept.h
               pthreads/src/main http_main.c
  Log:
  Add a per-thread pool, and make all worker threads use it instead of
  pchild, for thread-safety
  
  Revision  Changes    Path
  1.7       +1 -0      apache-apr/pthreads/src/include/http_accept.h
  
  Index: http_accept.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/include/http_accept.h,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -u -r1.6 -r1.7
  --- http_accept.h     1999/04/17 04:25:55     1.6
  +++ http_accept.h     1999/04/29 20:09:42     1.7
  @@ -71,6 +71,7 @@
       int pid;
       int tid;
       int sd;
  +    pool *tpool; /* "pthread" would be confusing */
   } proc_info;
   
   /* Select the accept technique. Move this to ap_config eventually... */
  
  
  
  1.79      +4 -2      apache-apr/pthreads/src/main/http_main.c
  
  Index: http_main.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/main/http_main.c,v
  retrieving revision 1.78
  retrieving revision 1.79
  diff -u -u -r1.78 -r1.79
  --- http_main.c       1999/04/29 19:34:21     1.78
  +++ http_main.c       1999/04/29 20:09:44     1.79
  @@ -1735,13 +1735,14 @@
       proc_info * ti = dummy;
       int process_slot = ti->pid;
       int thread_slot = ti->tid;
  +    pool *tpool = ti->tpool;
       struct sockaddr sa_client;
       int csd;
       pool *ptrans;            /* Pool for per-transaction stuff */
   
       free(ti);
   
  -    ptrans = ap_make_sub_pool(pchild);
  +    ptrans = ap_make_sub_pool(tpool);
   
       while (1) {
           (void) ap_update_child_status(process_slot, thread_slot, 
SERVER_READY, 
  @@ -1754,7 +1755,7 @@
        ap_clear_pool(ptrans);
       }
   
  -    ap_destroy_pool(ptrans);
  +    ap_destroy_pool(tpool);
       kill(ap_scoreboard_image->parent[process_slot].pid, SIGWINCH);
       ap_update_child_status(process_slot, thread_slot, SERVER_DEAD,
           (request_rec *) NULL);
  @@ -1929,6 +1930,7 @@
        my_info->pid = my_child_num;
           my_info->tid = i;
        my_info->sd = 0;
  +     my_info->tpool = ap_make_sub_pool(pchild);
        
        /* We are creating threads right now */
        (void) ap_update_child_status(my_child_num, i, SERVER_STARTING, 
  
  
  

Reply via email to