Opened 13 years ago
Closed 12 years ago
#3582 closed Bugs (fixed)
boost::interprocess::file_lock closes when file is opened then closed.
Reported by: | jcoffland | Owned by: | Ion Gaztañaga |
---|---|---|---|
Milestone: | Boost 1.45.0 | Component: | interprocess |
Version: | Boost 1.39.0 | Severity: | Problem |
Keywords: | file_lock open close | Cc: |
Description
An exclusive file lock is lost if the same file is opened and closed else where in the code.
The attached example was complied like this:
g++ -o boost_file_lock_test boost_file_lock_test.cpp -I<path/top/boost-1_39>/include/boost-1_39/
Running two instances with in 30 seconds demonstrates the bug. Both instances print 'Acquired lock' when one should print 'Could not acquire lock' and exit.
This affects, at the very least, Ubuntu 9.04 Linux but most likely other Linux systems and possibly other platforms.
Attachments (1)
Change History (3)
by , 13 years ago
Attachment: | boost_file_lock_test.cpp added |
---|
comment:1 by , 13 years ago
If this is expected behavior that it should probably be noted here http://www.boost.org/doc/libs/1_38_0/doc/html/interprocess/synchronization_mechanisms.html#interprocess.synchronization_mechanisms.file_lock.file_lock_not_thread_safe Caution: Synchronization limitations
comment:2 by , 12 years ago
Milestone: | Boost 1.41.0 → Boost-1.45.0 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Expected behwviour noted in documentation for Boost 1.45 in release branch
test case