apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Bannert <aa...@ebuilt.com>
Subject [PATCH] updates to httpd to work with the new APR thread API
Date Tue, 24 Jul 2001 00:53:06 GMT
And now the updates to httpd to get it working under httpd [cross posted
to new-httpd because I'll need someone with httpd commit access to update
this once the changes to APR have been commited].


This patch is just the bare minimum to get httpd working with the
new thread API. Changes affected the threaded and perchild MPMs. I'll
revisit both of these MPMs once I have a better idea what can change to
take advantage of the new API (it looks like we are using static/global
variables to pass the parent pool around to the threads...), but for
now this keeps up to date with APR and changes no real functionality.

-aaron

(patch follows quote)


On Mon, Jul 23, 2001 at 05:28:14PM -0700, Aaron Bannert wrote:
> Ok here goes again, hopefully third try's a charm.
> 
> 
> This patch updates the APR thread API as discussed on the list
> over the last week or so. Basicly, the following changes were made
> and are included in this patch:
> 
> - worker_function prototype (apr_thread_start_t) now takes two parameters,
>   the apr private data (apr_thread_t*) and the application private
>   data (void*).
> 
> - Applications' worker_thread() routines may now use the apr_thread_pool_get
>   routines to access the pool. These are implemented using the
>   APR_POOL_*_ACCESSOR() macros.
> 
> 
> This patch was tested on UNIX. For the sake of the reviewer, I will followup
> this messages with patches that update testthread.c and another that
> will implement the changes for httpd. Also, once this gets commited,
> I have a fix for apr_thread_join() that needs to get commited. :)



Index: server/mpm/perchild/perchild.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/server/mpm/perchild/perchild.c,v
retrieving revision 1.71
diff -u -r1.71 perchild.c
--- server/mpm/perchild/perchild.c	2001/07/18 20:45:35	1.71
+++ server/mpm/perchild/perchild.c	2001/07/24 00:40:46
@@ -512,7 +512,7 @@
     }
 }
 
-static void *worker_thread(void *);
+static void *worker_thread(apr_thread_t *, void *);
 
 /* Starts a thread as long as we're below max_threads */
 static int start_thread(void)
@@ -579,7 +579,7 @@
 
 /* idle_thread_count should be incremented before starting a worker_thread */
 
-static void *worker_thread(void *arg)
+static void *worker_thread(apr_thread_t *thd, void *arg)
 {
     apr_socket_t *csd = NULL;
     apr_pool_t *tpool;		/* Pool for this thread           */
Index: server/mpm/threaded/threaded.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/server/mpm/threaded/threaded.c,v
retrieving revision 1.46
diff -u -r1.46 threaded.c
--- server/mpm/threaded/threaded.c	2001/07/18 20:45:36	1.46
+++ server/mpm/threaded/threaded.c	2001/07/24 00:40:47
@@ -520,7 +520,7 @@
     apr_lock_release(pipe_of_death_mutex);
 }
 
-static void * worker_thread(void * dummy)
+static void * worker_thread(apr_thread_t *thd, void * dummy)
 {
     proc_info * ti = dummy;
     int process_slot = ti->pid;
@@ -671,7 +671,7 @@
     return 0;
 }
 
-static void *start_threads(void * dummy)
+static void *start_threads(apr_thread_t *thd, void * dummy)
 {
     thread_starter *ts = dummy;
     apr_thread_t **threads = ts->threads;


Mime
View raw message