Message136165
The sleep is too short:
def f():
with cond:
result = cond.wait_for(lambda : state==4)
for i in range(5):
time.sleep(0.01)
with cond:
state += 1
cond.notify()
If state is incremented to 5 before the thread waits on the condition, it's going to wait forever (it can be reproduced easily by removing the sleep).
We could either increase the sleep, or change the predicate to state==5. |
|
Date |
User |
Action |
Args |
2011-05-17 15:37:01 | neologix | set | recipients:
+ neologix, vstinner |
2011-05-17 15:37:01 | neologix | set | messageid: <1305646621.43.0.771546630148.issue12096@psf.upfronthosting.co.za> |
2011-05-17 15:37:00 | neologix | link | issue12096 messages |
2011-05-17 15:37:00 | neologix | create | |
|