On Wednesday, April 3, 2013, Philip Martin wrote:
Ben Reser <ben@reser.org> writes:

> On Wed, Apr 3, 2013 at 12:29 PM, Jeff Trawick <trawick@gmail.com> wrote:
>> I'm not aware of any apr_file_lock() use within httpd, so you wouldn't
>> regress anything (unless you're using third-party modules that use
>> apr_file_lock).  But I guess you've introduced a third-party module that
>> uses apr_file_lock() or you wouldn't be asking about this?
> Subversion uses apr_file_lock() and by extension so does mod_dav_svn.

The main place we use this is in the FSFS backend.  On multi-threaded
Unix systems we also use a mutex to ensure that only a single thread in
each process locks the file.  So the use of fcntl() should be OK here as
far as Subversion is concerned.

Cool, but APR needs a fix...

I didn't get a chance to check where if anywhere APR  uses a pthread mutex in conjunction with fcntl for mutexes...

There is also a lock for the BDB backend that is only used for certain
admin operations and those operations have a restriction that the caller
is responsible for calling the functions in a single-threaded context.
These functions are used by the single-threaded svnadmin program.


Born in Roswell... married an alien...