apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gregory Nicholls <gnicho...@bellsouth.net>
Subject apr_file_lock on WIN32 - possible bug ?
Date Wed, 14 Mar 2007 16:42:01 GMT
 Hi,
    My understanding of apr_file_lock() says that a second lock for the 
same process will not suspend.
I opened a new file on WIN32 with the following:
 apr_file_open(fd,APR_FOPEN_BINARY|APR_FOPENREAD|APR_FOPEN_WRITE|APR_FOPEN_APPEND|APR_FOPEN_CREATE,APR_OS_DEFAULT,pool);

Next I locked it with apr_file_lock(fd,APR_FLOCK_EXCLUSIVE);

An attempt to write to the file with 
apr_file_write_full(fd,ptr,len,&written); suspended.

 Looking in the apr code for file_write_full, it also grabs an exclusive 
lock.
A quick test with 2 successive calls to 
apr_file_lock(fd,APR_FLOCK_EXCLUSIVE) shows the same behaviour, the 
second lock suspends.
    Have I misunderstood something or is there a bug here ?
          Thanks,
             Greg.


Mime
View raw message