apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject Re: Reader/writer locks?
Date Tue, 01 May 2001 01:12:46 GMT
On Fri, Apr 27, 2001 at 09:33:00PM -0700, Justin Erenkrantz wrote:
> Are reader/writer locks implemented in APR?

We have reader/writer locks on files, but not "freestanding" locks.

Let's say that you have an apr_file_t handy. You can then arbitrate access
to it using the apr_file_lock() and apr_file_unlock() functions.

> In include/apr_lock.h:
> 
> typedef enum {APR_MUTEX, APR_READWRITE} apr_locktype_e;
> 
> I don't see any use of apr_locktype_e in APR (besides the definition
> in the apr_lock_t structure).  Are we just waiting for someone to 
> implement APR_READWRITE?  Is everything right now essentially acting
> as APR_MUTEX (regardless of what you pass in)?

As Ryan mentioned, that stuff is pending somebody implementing them. I
almost tossed them a while back since it is misleading to keep them there.
Somebody say "don't" and I didn't bother to push it.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Mime
View raw message