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 | __init__ | Undocumented |
Method | __repr__ | Undocumented |
Method | break_lock | Undocumented |
Method | get_physical_lock_status | Return physical lock status. |
Method | is_locked | Undocumented |
Method | lock_read | Acquire the lock in read mode. |
Method | lock_write | Acquire the lock in write mode. |
Method | unlock | Undocumented |
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.