mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 01:07:51 -04:00
tests: fix mutex test on win32 where mutexes are always reentrant
This commit is contained in:
parent
11ecd3af87
commit
1a94e65b17
@ -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()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user