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; @synthesize lock = _lock;
+ (void)networkRequestThreadEntryPoint:(id)__unused object { + (void)networkRequestThreadEntryPoint:(id)__unused object {
[[NSThread currentThread] setName:@"AFNetworking"]; @autoreleasepool {
[[NSRunLoop currentRunLoop] run]; [[NSThread currentThread] setName:@"AFNetworking"];
NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
[runLoop addPort:[NSMachPort port] forMode:NSDefaultRunLoopMode];
[runLoop run];
}
} }
+ (NSThread *)networkRequestThread { + (NSThread *)networkRequestThread {