~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/lock.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-06-28 07:08:27 UTC
  • mfrom: (2553.1.3 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20070628070827-h5s313dg5tnag9vj
(robertc) Show the names of commit hooks during commit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
    )
45
45
 
46
46
 
47
 
class _OSLock(object):
 
47
class _base_Lock(object):
48
48
 
49
49
    def __init__(self):
50
50
        self.f = None
109
109
    lock_EX = fcntl.LOCK_EX
110
110
 
111
111
 
112
 
    class _fcntl_FileLock(_OSLock):
 
112
    class _fcntl_FileLock(_base_Lock):
113
113
 
114
114
        def _unlock(self):
115
115
            fcntl.lockf(self.f, fcntl.LOCK_UN)
196
196
            return True, wlock
197
197
 
198
198
 
199
 
    class _fcntl_TemporaryWriteLock(_OSLock):
 
199
    class _fcntl_TemporaryWriteLock(_base_Lock):
200
200
        """A token used when grabbing a temporary_write_lock.
201
201
 
202
202
        Call restore_read_lock() when you are done with the write lock.
258
258
    LOCK_NB = win32con.LOCKFILE_FAIL_IMMEDIATELY
259
259
 
260
260
 
261
 
    class _w32c_FileLock(_OSLock):
 
261
    class _w32c_FileLock(_base_Lock):
262
262
 
263
263
        def _lock(self, filename, openmode, lockmode):
264
264
            self._open(filename, openmode)
374
374
                    ('hEvent', ctypes.c_void_p), # HANDLE
375
375
                   ]
376
376
 
377
 
    class _ctypes_FileLock(_OSLock):
 
377
    class _ctypes_FileLock(_base_Lock):
378
378
 
379
379
        def _lock(self, filename, openmode, lockmode):
380
380
            self._open(filename, openmode)