Part of bzrlib.counted_lock View In Hierarchy
This can be used with any object that provides a basic Lock interface, including LockDirs and OS file locks.
|Instance Variables||_token||While a write lock is held, this is the token for it.|
|Method||get_physical_lock_status||Return physical lock status.|
|Method||lock_read||Acquire the lock in read mode.|
|Method||lock_write||Acquire the lock in write mode.|
Returns true if a lock is held on the transport. If no lock is held, or the underlying locking mechanism does not support querying lock status, false is returned.
If the lock is already held in either read or write mode this increments the count and succeeds. If the lock is not already held, it is taken in read mode.
If the lock was originally acquired in read mode this will fail.
|Parameters||token||If given and the lock is already held, then validate that we already hold the real lock with this token.|
|Returns||The token from the underlying lock.|