James Walker
Thu, 17 Sep 2009 17:41:03 -0700
The setup code in the main thread (Listing 3-12) creates a port with [NSMachPort port]. This port is installed on the run loop (does the run loop retain the port?) and then passed to the worker thread. The worker thread function (Listing 3-14, +LaunchThreadWithPort:) takes that port and passes it to a method sendCheckinMessage of a newly created worker object. In sendCheckinMessage (Listing 3-15), the worker object retains the port, and uses it as a send port for a message. Now here's the part that confuses me: When control returns to Listing 3-14, the port gets released. Why? This class method didn't retain or create the port, so it shouldn't be releasing it, no?
-- James W. Walker, Innoventive Software LLC <http://www.frameforge3d.com/> _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com