Re: CFRunLoopStop exception
Re: CFRunLoopStop exception
- Subject: Re: CFRunLoopStop exception
- From: vincent habchi <email@hidden>
- Date: Fri, 9 Apr 2010 07:40:48 +0200
Jesper,
> FYI: Remember that corefoundation is open source. 10.6.2 can be found at: http://www.opensource.apple.com/source/CF/CF-550.13/
Thanks for the link, very instructive.
> void CFRunLoopWakeUp(CFRunLoopRef rl) {
> CHECK_FOR_FORK();
> #if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED
> kern_return_t ret;
> /* We unconditionally try to send the message, since we don't want
> * to lose a wakeup, but the send may fail if there is already a
> * wakeup pending, since the queue length is 1. */
> ret = __CFSendTrivialMachMessage(rl->_wakeUpPort, 0, MACH_SEND_TIMEOUT, 0);
> if (ret != MACH_MSG_SUCCESS && ret != MACH_SEND_TIMED_OUT) {
> HALT;
> }
Okay, so that means it is impossible to ask a run loop to stop while it is being messaged to wake up. Practically, this might not be a severe threat, but when you begin to create/destroy threads at small intervals (say, 50 ms), the collision seems to be inevitable (especially since I also use timers to wake up the loops). I wonder why the queue has only a single entry.
Anyhow, thanks again!
Vincent_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden