321
321
def test_35_wait_lock_changing(self):
322
322
"""LockDir.wait_lock() will report if the lock changes underneath.
324
324
This is the stages we want to happen:
326
326
0) Synchronization locks are created and locked.
327
327
1) Lock1 obtains the lockdir, and releases the 'check' lock.
328
328
2) Lock2 grabs the 'check' lock, and checks the lockdir.
330
330
and unsets the 'checked' lock.
331
331
3) Thread1 blocks on acquiring the 'checked' lock, and then tells
332
332
Lock1 to release and acquire the lockdir. This resets the 'check'
334
334
4) Lock2 acquires the 'check' lock, and checks again. It notices
337
337
5) Thread1 blocks on the 'checked' lock, this time, it completely
338
338
unlocks the lockdir, allowing Lock2 to acquire the lock.