Just for fun, here is another approach which doesn't block the caller thread (yes, I know I'm leaking the main thread instance but it shouldn't go away anyhow)
static NSThread *_mainThread = nil;

static __attribute__((constructor)) void _DPInitMainThread(void) {
_mainThread = [[NSThread currentThread] retain];
}

+ (NSThread *)mainThread {
return _mainThread;
}