~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/lockdir.py

  • Committer: Martin Pool
  • Date: 2008-05-27 02:54:53 UTC
  • mto: (3724.1.1 lock-hooks)
  • mto: This revision was merged to the branch mainline in revision 3730.
  • Revision ID: mbp@sourcefrog.net-20080527025453-g92mkdb1u2aterqe
Move physical lock hooks onto new PhysicalLock class variable

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006, 2007 Canonical Ltd
 
1
# Copyright (C) 2006, 2007, 2008 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
153
153
_DEFAULT_POLL_SECONDS = 1.0
154
154
 
155
155
 
156
 
class LockDir(object):
157
 
    """Write-lock guarding access to data."""
 
156
class LockDir(lock.PhysicalLock):
 
157
    """Write-lock guarding access to data.
 
158
    """
158
159
 
159
160
    __INFO_NAME = '/info'
160
161
 
327
328
                    (time.time() - start_time) * 1000)
328
329
            result = lock.LockResult(self.transport.abspath(self.path),
329
330
                old_nonce)
330
 
            for hook in lock.hooks['released']:
 
331
            for hook in self.hooks['released']:
331
332
                hook(result)
332
333
 
333
334
    def break_lock(self):
464
465
        result = self._attempt_lock()
465
466
        hook_result = lock.LockResult(self.transport.abspath(self.path),
466
467
                self.nonce)
467
 
        for hook in lock.hooks['acquired']:
 
468
        for hook in self.hooks['acquired']:
468
469
            hook(hook_result)
469
470
        return result
470
471