Marc Mongenet wrote:
Hello,

In apr_file_lock documentation, it is written:
"Locks are established on a per-thread/process basis;
a second lock by the same thread will not block."

It works like that on Unix.
But on Windows, a second call to apr_file_lock does block.

apr_file_lock(fd, APR_FLOCK_EXCLUSIVE);
apr_file_lock(fd, APR_FLOCK_EXCLUSIVE); /* blocks on Windows */

Correct; the documentation is wrong, locks on files operate like 
APR_LOCK_DEFAULT,
whichever is optimal/implemented for the platform is their behavior.  If you 
must
have a mutex object with specific behavior, use a mutex.

Bill

Reply via email to