apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Ruppert ...@myarm.com>
Subject Deadlock with apr_file_open(APR_FOPEN_APPEND) and apr_file_lock() under Windows
Date Tue, 05 Oct 2010 17:30:26 GMT
Hi all,

yesterday I ran into the following problem. I use the apr_file_lock() 
function in conjunction with the APR_FOPEN_APPEND flag and under Linux 
everything is fine.

Under Windows any attempt to write to the opened and locked file I get a 
deadlock. This is due the fact that apr_file_write() creates an own lock 
with apr_file_lock() if the file was opened with the APR_FOPEN_APPEND flag.

First this is inconsistent through different operating systems Unix does 
not lock, Windows does lock the file in append mode. However, I think 
the locking in the Windows implementation is wrong. The user has to 
choose if he wants to lock the file or not!

To reproduce the behavior please compile and test the attached example!

Any comments? Should I file a bug report?


View raw message