We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
why pinging run with mainthread? in children thread will call bug? The code :
(void)pingWithBlock:(void (^)(BOOL isSuccess, NSTimeInterval latency))completion { //NSLog(@"pingWithBlock"); if (completion) { // copy the block, then added to the blocks array. @synchronized(self) { [self.completionBlocks addObject:[completion copy]]; } }
if (!self.isPinging) { // MUST make sure pingFoundation in mainThread __weak __typeof(self)weakSelf = self; if (![[NSThread currentThread] isMainThread]) { dispatch_sync(dispatch_get_main_queue(), ^{ __strong __typeof(weakSelf)strongSelf = weakSelf; [strongSelf startPing]; }); } else { [self startPing]; } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
why pinging run with mainthread? in children thread will call bug?
The code :
(void)pingWithBlock:(void (^)(BOOL isSuccess, NSTimeInterval latency))completion
{
//NSLog(@"pingWithBlock");
if (completion)
{
// copy the block, then added to the blocks array.
@synchronized(self)
{
[self.completionBlocks addObject:[completion copy]];
}
}
if (!self.isPinging)
{
// MUST make sure pingFoundation in mainThread
__weak __typeof(self)weakSelf = self;
if (![[NSThread currentThread] isMainThread]) {
dispatch_sync(dispatch_get_main_queue(), ^{
__strong __typeof(weakSelf)strongSelf = weakSelf;
[strongSelf startPing];
});
}
else
{
[self startPing];
}
}
}
The text was updated successfully, but these errors were encountered: