[PyKDE] Threads and KApplication lock

Russell Valentine russ at coldstonelabs.org
Sat Sep 11 01:31:40 BST 2004


I have a threaded pykde application(using QThread not python threads). 
It also goes in the system tray. As I quickly found out, modifying 
pyqt(pykde) widgets from a separate thread without locking leads to hard 
crashes. Also there are crashes when playing a sound with KAudioPlayer 
without locking. So basically I lock when ever I play audio or update 
any of the GUI components of the application within a thread. I don't 
get those hard crashes, however at unpredictable times the application 
just locks up. I added debugging statements into the application and it 
always happens during the lock function call.

print "DEBUG: doing the lock"
self.parentApp.lock()
print "DEBUG: lock worked"

IE when it locks up I never see "lock worked".

I only have one QThread running.

Has anyone had any experiences like this and know how to go around it? 
Are there some special guidelines and issues I need to worry about when 
locking an app?


Russell Valentine
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20040911/735d66e9/signature.bin


More information about the PyQt mailing list