Re: [Pyobjc-dev] Achieving 1.0....
Brought to you by:
ronaldoussoren
From: Jack J. <Jac...@or...> - 2002-10-29 21:17:55
|
On dinsdag, oktober 29, 2002, at 02:06 , Bill Bumgarner wrote: >> To answer my own question: no, it doesn't. isMultiThreaded >> still returns NO after this call. >> Is this a problem? If so, is there a way to tell NSThread that >> we *are* multithreaded? > > That would seem to be a bug that should be reported to > bugreport.apple.com. If you have a little hunk of test code, > that typically accelerates Apple's bug fixing process > considerably. I'll try and find the time, but feel free to beat me to it:-) > > It sounds like you'll need to create a zero resources thread > via NSThread: > > [NSThread detachNewThreadSelector:@selector(intoTheVoid:) > toTarget:[NSObject class] withObject: nil]; > > @implementation NSObject (TheVoid) > + (void) intoTheVoid: aNothing > { > l = [[NSLock alloc] init]; > [l lock]; > [l lock]; > } > @end I did this (but of course with a bit of code a lot less elegant than yours:-), and it solves the isMultiThreaded problem. Unfortunately it doesn't solve my PyOpenGL problem, but that's a different story... Something else you may want to try though, if this is needed for PyObjC, is to let the thread terminate. The comments in NSThread.h lead me to believe that once you've made the transition to a multithreaded program there's no going back. If that's indeed the case then letting the thread terminate isn't a problem. -- - Jack Jansen <Jac...@or...> http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - |