|
@@ -6,7 +6,7 @@ def test_mutex_acquire_release():
|
|
|
m.acquire()
|
|
m.acquire()
|
|
|
|
|
|
|
|
# Assert that the lock is truly held now
|
|
# Assert that the lock is truly held now
|
|
|
- assert not m.try_acquire()
|
|
|
|
|
|
|
+ assert m.debug_is_locked()
|
|
|
|
|
|
|
|
# Release the lock
|
|
# Release the lock
|
|
|
m.release()
|
|
m.release()
|
|
@@ -25,7 +25,7 @@ def test_mutex_try_acquire():
|
|
|
assert m.try_acquire()
|
|
assert m.try_acquire()
|
|
|
|
|
|
|
|
# Assert that the lock is truly held now
|
|
# Assert that the lock is truly held now
|
|
|
- assert not m.try_acquire()
|
|
|
|
|
|
|
+ assert m.debug_is_locked()
|
|
|
|
|
|
|
|
# Clean up
|
|
# Clean up
|
|
|
m.release()
|
|
m.release()
|
|
@@ -45,9 +45,15 @@ def test_remutex_try_acquire():
|
|
|
# Trying to acquire the lock should succeed
|
|
# Trying to acquire the lock should succeed
|
|
|
assert m.try_acquire()
|
|
assert m.try_acquire()
|
|
|
|
|
|
|
|
|
|
+ # Should report being locked
|
|
|
|
|
+ assert m.debug_is_locked()
|
|
|
|
|
+
|
|
|
# Trying a second time should succeed
|
|
# Trying a second time should succeed
|
|
|
assert m.try_acquire()
|
|
assert m.try_acquire()
|
|
|
|
|
|
|
|
|
|
+ # Should still report being locked
|
|
|
|
|
+ assert m.debug_is_locked()
|
|
|
|
|
+
|
|
|
# Clean up
|
|
# Clean up
|
|
|
m.release()
|
|
m.release()
|
|
|
m.release()
|
|
m.release()
|