mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 16:20:11 -04:00
tests: hopefully make notify_all() test more robust
This commit is contained in:
parent
71eaa65e4e
commit
362ee33d32
@ -123,12 +123,16 @@ def test_cvar_notify_all_threads(num_threads):
|
|||||||
break
|
break
|
||||||
|
|
||||||
assert state['waiting'] == num_threads
|
assert state['waiting'] == num_threads
|
||||||
m.release()
|
|
||||||
|
|
||||||
# OK, now signal it, and yield. All threads must unblock.
|
# OK, now signal it, and yield. All threads must unblock.
|
||||||
cv.notify_all()
|
cv.notify_all()
|
||||||
yield_thread()
|
for i in range(1000):
|
||||||
m.acquire()
|
m.release()
|
||||||
|
yield_thread()
|
||||||
|
m.acquire()
|
||||||
|
if state['waiting'] == 0:
|
||||||
|
break
|
||||||
|
|
||||||
assert state['waiting'] == 0
|
assert state['waiting'] == 0
|
||||||
m.release()
|
m.release()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user