~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/lock.py

  • Committer: Aaron Bentley
  • Date: 2005-10-04 04:32:32 UTC
  • mfrom: (1185.12.6)
  • mto: (1185.12.13)
  • mto: This revision was merged to the branch mainline in revision 1419.
  • Revision ID: aaron.bentley@utoronto.ca-20051004043231-40302a149769263b
merged my own changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
112
112
        import win32con, win32file, pywintypes
113
113
 
114
114
 
115
 
        LOCK_SH = 0 # the default
116
 
        LOCK_EX = win32con.LOCKFILE_EXCLUSIVE_LOCK
117
 
        LOCK_NB = win32con.LOCKFILE_FAIL_IMMEDIATELY
 
115
        #LOCK_SH = 0 # the default
 
116
        #LOCK_EX = win32con.LOCKFILE_EXCLUSIVE_LOCK
 
117
        #LOCK_NB = win32con.LOCKFILE_FAIL_IMMEDIATELY
118
118
 
119
119
        class _w32c_FileLock(_base_Lock):
120
120
            def _lock(self, filename, openmode, lockmode):
139
139
 
140
140
        class _w32c_ReadLock(_w32c_FileLock):
141
141
            def __init__(self, filename):
142
 
                _w32c_FileLock._lock(self, filename, 'rb',
143
 
                                     LOCK_NB)
 
142
                _w32c_FileLock._lock(self, filename, 'rb', 0)
144
143
 
145
144
        class _w32c_WriteLock(_w32c_FileLock):
146
145
            def __init__(self, filename):
147
146
                _w32c_FileLock._lock(self, filename, 'wb',
148
 
                                     LOCK_EX + LOCK_NB)
 
147
                                     win32con.LOCKFILE_EXCLUSIVE_LOCK)
149
148
 
150
149
 
151
150