Hans Meine wrote: > I just want to notice that there is the theoretic possibility of a context > switch between the "if len(...):" and the lock.acquire(). In this case, > self.queue might be emptied by another thread(?) and accessing [0] later > (after this thread being activated again) would result in an exception. > (BTW: wouldn't the release() call be missing in that situation?)
That can't happen because only the main thread is getting events from teh queue. The lock is for threads who put something in it. > I really do not know enough about Freevo's usage of the > EventHandler, however from reading the comment about thread-safety, > I would propose one of the attached patches (the _shorter one doing > the acquire() before the len() call) just to be sure. Thanks, but not needed. Current cvs doesn't use threads anymore. Dischi -- I pretend to work. They pretend to pay me.
pgp85KbVuGGe3.pgp
Description: PGP signature
