Updating ITFoundation to include updates spurred by Haven development.
[ITFoundation.git] / ITThreadChild.m
1 #import "ITThreadChild.h"
2
3 @implementation ITThreadChild
4
5 + (void)runWithPorts:(NSArray *)portArray {
6         NSAutoreleasePool *pool;
7         NSConnection *parentConnection;
8         id childObject;
9         
10         pool = [[NSAutoreleasePool alloc] init];
11         
12         parentConnection = [NSConnection connectionWithReceivePort:[portArray objectAtIndex:0] sendPort:[portArray objectAtIndex:1]];
13         
14         childObject = [self alloc];
15         if ([(id <ITThreadParent>)[parentConnection rootProxy] registerThreadedChild:childObject]) {
16                 [[NSRunLoop currentRunLoop] run];
17         }
18         
19         [childObject release];
20         [pool release];
21 }
22
23 @end