AFNetworking/AFNetworking — pull request #1077 by mattt (2013-06-19 03:42:22+00:00)
Title: Simplifying Network Thread Entry Point

`AFURLConnectionOperation +networkRequestThreadEntryPoint:` has always been the spookiest part of AFNetworking. For the life of me, I never quite understood _what_ that was doing, or why any of it was necessary. But boy did it look cool. `__attribute__((noreturn))`? `do {} while (YES)`. Baller. 100% Cargo Cult awesomesauce.

However, looking through the `NSRunLoop` docs, and playing around with a few things just now, I found that this:

```objective-c
+ (void)networkRequestThreadEntryPoint:(id)__unused object {
[[NSThread currentThread] setName:@"AFNetworking"];
[[NSRunLoop currentRunLoop] run];
}
```

...worked just fine. It certainly is easier to understand and more performant-looking than the version in `master`:

```objective-c
+ (void) __attribute__((noreturn)) networkRequestThreadEntryPoint:(id)__unused object {
do {
@autoreleasepool {
[[NSThread currentThread] setName:@"AFNetworking"];
[[NSRunLoop currentRunLoop] run];
}
} while (YES);
}
```

Can anyone explain why the proposed version would be in any way inferior to the current version (or actually doesn't work for some reason)?