apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Stoddard" <b...@wstoddard.com>
Subject Re: [PATCH] RW lock Iteration 2 for Windows
Date Mon, 30 Apr 2001 16:31:27 GMT
Christian,
I have not looked at this patch in excruciating detail but...


> Hi
> 
> Here is the second iteration of the RW lock code for the Windows.  It
> includes the fix for the cross-process RW lock.
> 
> Christian 
> 
<snip>

>  
> +    if (newlock->type == APR_MUTEX) {
> +        newlock->blockedReader = NULL;
> +        newlock->blockedWriter = NULL;
> +    }
>      if (scope == APR_INTRAPROCESS) {
>          InitializeCriticalSection(&newlock->section);
> +        if (newlock->type == APR_READWRITE) {
> +            newlock->blockedReader = CreateMutex(NULL, FALSE, NULL);
> +         newlock->blockedWriter = CreateMutex(NULL, FALSE, NULL);
> +        }    
>      } else {
>          newlock->mutex = CreateMutex(&sec, FALSE, fname);
> +        if (newlock->type == APR_READWRITE) {
> +            char *tmp;
> +
> +            tmp = apr_pstrcat( cont, fname, ".BlockedReader", NULL);
> +            newlock->blockedReader = CreateMutex(&sec, FALSE, tmp);
> +            tmp = apr_pstrcat( cont, fname, ".BlockedWriter", NULL);
> +         newlock->blockedWriter = CreateMutex(&sec, FALSE,
> NULL);
> +        }    

This looks wrong.  An APR_INTRAPROCESS lock should use a critical section, not a mutex. 

Bill



Mime
View raw message