On 16-mei-2005, at 20:53, [EMAIL PROTECTED] wrote:
NO! That is really really horribly bad to do. Working around a bug in PyObjC by writing code that will break in correct versions of PyObjC is absolutely horrible. You should NEVER release the lock unless you own it.
Here, then, is probably the heart of the problem - the interactions between python threads spawned by threading.Thread and the main (objc) thread and performSelectorOnMainThread are "undefined", and the more I look at it, the more it appears that using threading.Thread in a PyObjC app is a bad idea and should probably just be chalked up as "unsupported and probably won't work". It appears that I'd need to build something on top of NSThread (in Objective-C) with explicit thread state handling to get this to work consistently and correctly.
Threading.Thread should work as long as Cocoa knows that the application is
multithreaded or you don't call Cocoa outside of the main thread. (See
http://developer.apple.com/documentation/Cocoa/Conceptual/ Multithreading/index.html#//apple_ref/doc/uid/10000057i,
threading.Thread uses POSIX threads)
Using NSThread is slightly cleaner if you do call Cocoa API's from secondairy threads.
Ronald
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig