File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -131,16 +131,16 @@ def wait(self, timeout=None):
131
131
elapsed, or ``False`` otherwise. If *timeout* is ``None`` (the default)
132
132
wait indefinitely.
133
133
"""
134
+ # XXX Either add a "launch" param to this method, or add a launch
135
+ # method to the class so that consumers can use the lock to launch
136
+ # an appropriate emulation
134
137
end = time ()
135
- if timeout is None :
136
- wait = 0.1
137
- else :
138
+ if timeout is not None :
138
139
end += timeout
139
- wait = max (0 , timeout / 10 )
140
140
while not self ._is_held () or self ._is_stale ():
141
141
if time () > end :
142
142
return False
143
- sleep (wait )
143
+ sleep (0.1 )
144
144
return True
145
145
146
146
@property
@@ -192,4 +192,3 @@ def _write_pid(self):
192
192
self ._filename , os .O_CREAT | os .O_EXCL | os .O_WRONLY , mode ), 'w' )
193
193
lockfile .write ('%d\n ' % os .getpid ())
194
194
lockfile .close ()
195
-
You can’t perform that action at this time.
0 commit comments