Hi all, I forward you the message I sent on comp.lang.python, hoping that someone will show me how dumb I am. Or maybe I stumbled across a python bug...
---------- Forwarded message ---------- From: <stephane.bisin...@gmail.com> Date: 2009/4/18 Subject: Condition.wait(0.5) doesn't respect it's timeout To: stephane.bisin...@gmail.com Hi all, I have a problem with Condition.wait(), it doesn't return after the given timeout. The thing is that if I try to create a simple program, it works as expected, but in the actual code, the timeout is not respected (albeit the notify()s work as expected). You can find the code I am talking about here: http://github.com/Kjir/amsn2/blob/6688da4c0b7cc16c0fe04d6d6018bc1b16d992a6/amsn2/gui/front_ends/curses/contact_list.py If you clone the repository, then you can run the program like this: $ python amsn2.py -f curses 2>> run.log and in another term watch for prints with a tail -f run.log (You need an MSN account). You'll notice that after the initial downloading of the contact list, there won't be any logs (unless some of your contacts changes status, which will trigger a notify) Has anyone the slightest idea on what I may be doing wrong? Or am I just lucky enough to have stumbled across a bug? Maybe pollution from another module in other parts of the code? (Like gobject...) Anyway just for completeness here is a sample program that works for me: from threading import Thread from threading import Condition def some_func(): while True: cond.acquire() while True: cond.wait(0.5) print "Hello, world!" cond = Condition() thread = Thread(target=some_func) thread.start() thanks, Stéphane Bisinger -- Stéphane ------------------------------------------------------------------------------ Stay on top of everything new and different, both inside and around Java (TM) technology - register by April 22, and save $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. 300 plus technical and hands-on sessions. Register today. Use priority code J9JMT32. http://p.sf.net/sfu/p _______________________________________________ Amsn-devel mailing list Amsn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/amsn-devel