Re: [Q] CFSocket & RunLoop --2nd try
Re: [Q] CFSocket & RunLoop --2nd try
- Subject: Re: [Q] CFSocket & RunLoop --2nd try
- From: Douglas Davidson <email@hidden>
- Date: Thu, 22 Jan 2004 11:01:13 -0800
On Jan 22, 2004, at 6:57 AM, Shawn Erickson wrote:
An important thing to note about run loops are that they can only be
run if it they have at least one input source. If they are running and
the last input source is removed (or invalidated I believe) the run
loop will return (stop running).
However, bear in mind that it is not always the case that the only
sources installed are your own. Various frameworks may install run
loop sources for their own purposes, so it is not wise to rely on the
removal of the last input source to stop the running of the run loop.
In many cases an entire thread is intended to operate within the run
loop, so that the run loop does not need to stop running before the
thread (or process) exits. If, however, you need to stop running a run
loop and continue execution on a particular thread, the instead of
using the convenience function CFRunLoopRun, you can instead call
CFRunLoopRunInMode in a loop, and in the condition for the loop check
something that indicates whether all of the run loop processing you
needed is complete.
Douglas Davidson
_______________________________________________
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.