apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject Re: [PATCH] APR thread updates and associated httpd-2.0 changes
Date Sat, 21 Jul 2001 15:17:10 GMT
From: "Aaron Bannert" <aaron@ebuilt.com>
Sent: Saturday, July 21, 2001 1:52 AM


> [Still trying to get the hang of this whole patch-submission/OSS project/
> mailing list thing :) -- this patch should be *much* smaller]

Much improved :)

> Update to APR thread API to explicitly pass the apr_thread_t to the
> worker function.

Good choice

> Changed the worker routine's signature to take a single parameter:
> apr_thread_param_t, which contains the opaque data and the apr_thread_t.

Can we simply hide the details, and use our own _thread_main starting point?
Put the thread start function ptr in this structure as well, have our 
_thread_main unwrap whatever is required (and it can create thread-local
data, if we ever implement that), finally calling out to the user's *func? 

> httpd-2.0 will have to be updated after applying this patch to APR.

Not if we hide this detail, I believe.  I don't know what that does about
providing access to the apr_thread_t in the child thread.  Perhaps we declare
the user's func as accepting arguments (apr_thread_t *me, void *mine).

Bill


> Index: srclib/apr/include/apr_thread_proc.h
> ===================================================================
> RCS file: /home/cvspublic/apr/include/apr_thread_proc.h,v
> retrieving revision 1.65
> diff -u -r1.65 apr_thread_proc.h
> --- srclib/apr/include/apr_thread_proc.h 2001/06/06 18:11:06 1.65
> +++ srclib/apr/include/apr_thread_proc.h 2001/07/21 06:43:58
> @@ -125,7 +125,13 @@
>  typedef struct apr_other_child_rec_t  apr_other_child_rec_t;
>  #endif /* APR_HAS_OTHER_CHILD */
>  
> -typedef void *(APR_THREAD_FUNC *apr_thread_start_t)(void *);
> +struct apr_thread_param_t {
> +    apr_thread_t *t;
> +    void *data;
> +};
> +typedef struct apr_thread_param_t apr_thread_param_t;
> +
> +typedef void *(APR_THREAD_FUNC *apr_thread_start_t)(apr_thread_param_t *);

My only objection is making this new struct 'public'.  If we 'actually' invoked
our own static start_thread function 


Mime
View raw message