apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cliff Woolley <cliffwool...@yahoo.com>
Subject Re: warnings with APR_USE_PROC_PTHREAD_SERIALIZE
Date Mon, 02 Jul 2001 14:48:40 GMT
On 2 Jul 2001, Jeff Trawick wrote:

> struct apr_os_lock_t {
> #if APR_HAS_PROC_PTHREAD_SERIALIZE
>     pthread_mutex_t *pthread_crossproc; /* NULL if not used */
> #endif
> #if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE
>     int int_crossproc;                  /* -1 if not used */
> #endif
> #if APR_USE_PTHREAD_SERIALIZE
>     pthread_mutex_t *pthread_intraproc; /* NULL if not used */
> #endif
> };
>
> in apr_os_lock_get():
>
> #if APR_HAS_PROC_PTHREAD_SERIALIZE
>     os->pthread_crossproc = lock->pthread_interproc;
> #endif
> #if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE
>     os->int_crossproc = lock->interproc;
> #endif
> #if APR_USE_PTHREAD_SERIALIZE
>     os->pthread_intraproc = lock->intraproc;
> #endif
>

That's essentially what Ryan did last night...


> In create_lock(), initialize as follows before filling in any lock handles:
>
> #if APR_HAS_PROC_PTHREAD_SERIALIZE
>     new->pthread_interproc = NULL;
> #endif
> #if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE
>     new->interproc = -1;
> #endif
> #if APR_USE_PTHREAD_SERIALIZE
>     new->intraproc = NULL;
> #endif

We didn't catch this part, though.  The apr_lock_t is pcalloc'ed just
prior to calling create_lock().  Do we really need to do this?  If so,
feel free to add it in...

--Cliff



--------------------------------------------------------------
   Cliff Woolley
   cliffwoolley@yahoo.com
   Charlottesville, VA



Mime
View raw message