[PyKDE] Re: PyQt semaphore.py example on Windows

Paul Felix pef at fluent.com
Wed Jul 24 04:09:00 BST 2002


Paul Felix wrote:
> 
> > >>It *should* be Ok. My Windows platform is W2K and that's a test I always
> > >>check - but I probably haven't under Qt 3.0.5, Qt 3.0.4 was probably the
> > >>latest I tried.
> > >>
> > >
> > > You're right.  There's a change in QWaitCondition::wakeAll in Qt 3.0.5 where
> > > a call to SetEvent has been replaced by a call to PulseEvent.  That seems to
> > > be the cause of the problem.  I'm not sure why the C++ semaphore example still
> > > works though.  This Win32 Event API is confusing too.
> >
> >
> > What makes you think this is the cause of the problem - given that
> > semaphore.py doesn't use QWaitCondition?
> 
> QSemaphore uses QWaitCondition.
> 

The difference between the C++ example and the Python example is the use of
++ and -- operators versus += and -= to increment and decrement the
semaphores.  The ++ and -- operator functions do not exercise the wait
condition.  If you change the C++ code to use += 1 and -= 1, it also locks up.
I would call that a bug in Qt 3.0.5 -- I'll report that to Trolltech.

Paul
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pef.vcf
Type: text/x-vcard
Size: 241 bytes
Desc: Card for Paul Felix
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20020724/4ee27bfa/pef.vcf


More information about the PyQt mailing list