apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Gross <ChristianGr...@yahoo.de>
Subject Re: [PATCH] RW lock Iteration 2 for Windows
Date Mon, 30 Apr 2001 19:11:29 GMT
On Mon, 30 Apr 2001 12:31:27 -0400, you wrote:
>This looks wrong.  An APR_INTRAPROCESS lock should use a critical section, not a mutex.


Ooops...  

Now I remember why I also use Mutexes.  Mutexes can be signaled and
with the reader writer code I need to be able to signal a single
blocked writer or reader.  This is not possible with a critical
section.

BTW I was also wondering about the structure in locks.h.

Right now it is this.

struct apr_lock_t {
    apr_pool_t *cntxt;
    apr_locktype_e type;
    apr_lockscope_e scope;
    HANDLE mutex;
    CRITICAL_SECTION section;
    char *fname;
};

Would it not be better to do the following?

struct apr_lock_t {
    apr_pool_t *cntxt;
    apr_locktype_e type;
    apr_lockscope_e scope;
    union {
        HANDLE mutex;
        CRITICAL_SECTION section;
    };
    char *fname;
};


Christian

Mime
View raw message