/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/counted_lock.py

  • Committer: Marius Kruger
  • Date: 2010-07-10 21:28:56 UTC
  • mto: (5384.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5385.
  • Revision ID: marius.kruger@enerweb.co.za-20100710212856-uq4ji3go0u5se7hx
* Update documentation
* add NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Counted lock class"""
18
18
 
19
 
from __future__ import absolute_import
20
19
 
21
 
from . import (
 
20
from bzrlib import (
22
21
    errors,
23
22
    )
24
23
 
29
28
    This can be used with any object that provides a basic Lock interface,
30
29
    including LockDirs and OS file locks.
31
30
 
32
 
    :ivar _token: While a write lock is held, this is the token
 
31
    :ivar _token: While a write lock is held, this is the token 
33
32
        for it.
34
33
    """
35
34
 
40
39
 
41
40
    def __repr__(self):
42
41
        return "%s(%r)" % (self.__class__.__name__,
43
 
                           self._real_lock)
 
42
            self._real_lock)
44
43
 
45
44
    def break_lock(self):
46
45
        self._real_lock.break_lock()
81
80
 
82
81
        If the lock was originally acquired in read mode this will fail.
83
82
 
84
 
        :param token: If given and the lock is already held,
 
83
        :param token: If given and the lock is already held, 
85
84
            then validate that we already hold the real
86
85
            lock with this token.
87
86