All pastes #802803 Raw Edit

Mine

public text v1 · immutable
#802803 ·published 2007-11-30 17:40 UTC
rendered paste body
static NSMapTable *pThreadMessagePorts = NULL;

@implementation InterThreadManager

+ (void) initialize {
	pThreadMessagePorts = NSCreateMapTable(...);
}

@end



@implementation NSThread (InterThreadMessaging)

+ (void) prepareForInterThreadMessages
{
    /* Force the class initialization. */
    [InterThreadManager class];

    createMessagePortForThread([NSThread currentThread], [NSRunLoop currentRunLoop]);
}

@end



static void
createMessagePortForThread (NSThread *thread, NSRunLoop *runLoop)
{
    assert(NULL != pThreadMessagePorts);
}