Re: NSThreadWillExitNotification, Thread and notification
Re: NSThreadWillExitNotification, Thread and notification
- Subject: Re: NSThreadWillExitNotification, Thread and notification
- From: Eric Cheymol <email@hidden>
- Date: Wed, 22 Oct 2003 15:55:49 +0200
Hello Shaun,
Le 22 oct. 03, ` 14:16, Shaun Wexler a icrit :
On Oct 22, 2003, at 3:45 AM, Eric Cheymol wrote:
I use an observer to be informed of the end of a thread.
If this is a one-shot method running in a detached thread that you
wish to observe the exit notification, simply call your
-finishLoadLibrary: method directly, at the end of the thread's
method. The NSThreadWillExitNotification is posted from that thread,
anyhow.
Yes you are right, this is a one shot call. I first wanted to call the
-finishLoadLibrary: method in the main thread instead of the detached
thread and I wanted to use the notification feature in my program. But
this is not necessary.
All runs perfectly with Jaguar for months.
Since the 7B85 install, I check my app and I saw that the observer
receives too many notifications : all of NSConcreteNotification
instead of NSThreadWillExitNotification.
NSConcreteNotification is a private subclass of NSNotification.
NSThreadWillExitNotification is the symbol for a constant NSString.
All notifications we receive are usually of the NSConcreteNotification
class, unless for some reason NSNotification has been subclassed.
It is possible that some AppKit operations, which previously used
transient pthreads, are now detaching NSThreads instead? Fade-out of
a pop-up menu is something that comes to mind...
This is exactly what happens : when I select a folder in a openPanel,
my main thread receives a NSThreadWillExitNotification notification.
The consequence is that my method is called several times instead of
only once at the end of the load ;-(( The openPanel method works
differently in Jaguar : it probably uses only one thread only.
I remove the observer and call the -finishLoadLibrary: method at the
end of the detached thread and all works perfectly now.
Thanks for your help,
Eric Cheymol
----------------
Get the European shogi archives at
http://echeymol.free.fr/
The first Mac OS X Shogi Database Program at
http://www.macshogi.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.