Show More
@@ -221,8 +221,11 b' class lock(object):' | |||
|
221 | 221 | self.vfs.unlink(self.f) |
|
222 | 222 | except OSError: |
|
223 | 223 | pass |
|
224 | for callback in self.postrelease: | |
|
225 |
|
|
|
224 | # The postrelease functions typically assume the lock is not held | |
|
225 | # at all. | |
|
226 | if not self._parentheld: | |
|
227 | for callback in self.postrelease: | |
|
228 | callback() | |
|
226 | 229 | |
|
227 | 230 | def release(*locks): |
|
228 | 231 | for lock in locks: |
@@ -169,7 +169,7 b' class testlock(unittest.TestCase):' | |||
|
169 | 169 | |
|
170 | 170 | childlock.release() |
|
171 | 171 | childstate.assertreleasecalled(True) |
|
172 |
childstate.assertpostreleasecalled( |
|
|
172 | childstate.assertpostreleasecalled(False) | |
|
173 | 173 | childstate.assertlockexists(True) |
|
174 | 174 | |
|
175 | 175 | parentstate.resetacquirefn() |
@@ -208,7 +208,7 b' class testlock(unittest.TestCase):' | |||
|
208 | 208 | |
|
209 | 209 | lock2.release() |
|
210 | 210 | state2.assertreleasecalled(True) |
|
211 |
state2.assertpostreleasecalled( |
|
|
211 | state2.assertpostreleasecalled(False) | |
|
212 | 212 | state2.assertlockexists(True) |
|
213 | 213 | |
|
214 | 214 | state1.resetacquirefn() |
@@ -217,7 +217,7 b' class testlock(unittest.TestCase):' | |||
|
217 | 217 | |
|
218 | 218 | lock1.release() |
|
219 | 219 | state1.assertreleasecalled(True) |
|
220 |
state1.assertpostreleasecalled( |
|
|
220 | state1.assertpostreleasecalled(False) | |
|
221 | 221 | state1.assertlockexists(True) |
|
222 | 222 | |
|
223 | 223 | lock0.release() |
@@ -245,7 +245,7 b' class testlock(unittest.TestCase):' | |||
|
245 | 245 | # release the child lock |
|
246 | 246 | childlock.release() |
|
247 | 247 | childstate.assertreleasecalled(True) |
|
248 |
childstate.assertpostreleasecalled( |
|
|
248 | childstate.assertpostreleasecalled(False) | |
|
249 | 249 | childstate.assertlockexists(True) |
|
250 | 250 | |
|
251 | 251 | parentlock.release() |
General Comments 0
You need to be logged in to leave comments.
Login now