This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author neologix
Recipients neologix, vstinner
Date 2011-05-17.15:37:00
SpamBayes Score 6.853129e-08
Marked as misclassified No
Message-id <1305646621.43.0.771546630148.issue12096@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2011-05-17 15:37:01neologixsetrecipients: + neologix, vstinner
2011-05-17 15:37:01neologixsetmessageid: <1305646621.43.0.771546630148.issue12096@psf.upfronthosting.co.za>
2011-05-17 15:37:00neologixlinkissue12096 messages
2011-05-17 15:37:00neologixcreate