Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Notification handling without run loop of a primary thread



Hi Brian,

    Thanks for so quick reply.

> The run loop needs an event source or it will just exit (as you  
> witnessed). So, before calling CFRunLoopRun() you should register  
> your notification handler with the run loop.

    I noticed that when I add a notification observer in a primary
    thread using the CFNotificationCenterAddObserver the run
    loop works correctly without any source and CFRunLoopRun
    does not return a control, this in turn adds some entries to a run
    loop internal representation -- modes and current modes set
    entries, this set does not contain any source!:
    CFShow(CFRunLoopGetCurrent()), but if I do
    the same in a separate thread an internal run loop set contains
    appropriate entries, but its behavior are not the same.
    As I get, this is the one mechanism to register notification
    handler with a run loop.

    Would you please suggest me how should I initialize
    a run loop source you mentioned? Moreover, I have
    no idea about an infill of its context (I mean
    CFRunLoopSourceContext structure).

    Thanks again.

Best regards,
Vladimir Magaziy.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden

References: 
 >Notification handling without run loop of a primary thread (From: "Vladimir Magaziy" <email@hidden>)
 >Re: Notification handling without run loop of a primary thread (From: Brian Bergstrand <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.