Adding Mach port to keep runloop alive

This commit is contained in:
Mattt Thompson 2013-06-19 08:44:36 -07:00
parent 0ae4872df8
commit c75b9f46c3

View file

@ -187,8 +187,13 @@ static BOOL AFSecKeyIsEqualToKey(SecKeyRef key1, SecKeyRef key2) {
@synthesize lock = _lock;
+ (void)networkRequestThreadEntryPoint:(id)__unused object {
@autoreleasepool {
[[NSThread currentThread] setName:@"AFNetworking"];
[[NSRunLoop currentRunLoop] run];
NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
[runLoop addPort:[NSMachPort port] forMode:NSDefaultRunLoopMode];
[runLoop run];
}
}
+ (NSThread *)networkRequestThread {