#include <lock_file.h>
Inheritance diagram for more::io::lock_file:
aquire(access)
. More...aquire(access)
. More...
Read-only locks are not NFS safe (TODO). A workaround is to use access_rw
also when only read access is needed.
|
Construct an undefined lock file handle.
|
|
Construct a handle for a named lock file, but do not create the file yet.
|
|
Calls unlock().
|
|
\depreciated Use another constructor. Construct a handle and create the lock file with the given name if possible. If blocking=true it will hang until it manages to create the lock. |
|
Return the current access of the lock.
|
|
Try to obtain the lock without blocking, and return true if successful.
The valid arguments for access are |
|
Attempt every dt seconds indefinitely to
See |
|
Attempt every dt seconds for t seconds to
Return true if the lock was obtained. See |
|
Return
|
|
\depreciated Use Returns true after successful locking and before unlock(). |
|
\depreciated Establish the lock with the given file name.
|
|
Release all access. This function should ideally neither hang nor fail. In the case of read-only locks, however, it may in exceptional cases hang for a few seconds, and possibly fail. This may be the case if another program was interrupted at the critical stage while adjusting its own read-only lock, or if the lock files were tampered with. |
|
Set or change the file name of the lock. This causes an unlock. |
|
Swap two locks.
|
|
\depreciated Same ass release().
|