Re: NSThreadWillExitNotification, Thread and notification
Re: NSThreadWillExitNotification, Thread and notification
- Subject: Re: NSThreadWillExitNotification, Thread and notification
- From: Shaun Wexler <email@hidden>
- Date: Wed, 22 Oct 2003 05:16:53 -0700
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.
I register the observer method with the standard call :
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(finishLoadLibrary:)
name:NSThreadWillExitNotification object:nil];
Since you passed nil for the specific object to be observed, _ANY_
NSThread that exits will message your method; the notification is
performed in the exiting NSThread itself.
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...
--
Shaun Wexler
MacFOH
http://www.macfoh.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.