aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objective-c/GRPCClient/private/GRPCChannel.m
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2018-11-14 18:48:09 -0800
committerGravatar Muxi Yan <mxyan@google.com>2018-11-14 18:48:09 -0800
commitb5434c05aaaacfba9d6ef6882b6c1f3285a304e2 (patch)
tree64a767eaeeb29ce5ba683f928688692ec26eab1c /src/objective-c/GRPCClient/private/GRPCChannel.m
parent2bd38f29df16b874bea254e001e3c40d6945c28c (diff)
Make tests pass
Diffstat (limited to 'src/objective-c/GRPCClient/private/GRPCChannel.m')
-rw-r--r--src/objective-c/GRPCClient/private/GRPCChannel.m11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCChannel.m b/src/objective-c/GRPCClient/private/GRPCChannel.m
index 52dacad9f5..f63157c974 100644
--- a/src/objective-c/GRPCClient/private/GRPCChannel.m
+++ b/src/objective-c/GRPCClient/private/GRPCChannel.m
@@ -281,15 +281,14 @@ static const NSTimeInterval kDefaultChannelDestroyDelay = 30;
// This function should be called on _dispatchQueue.
- (void)ref {
- dispatch_sync(_dispatchQueue, ^{
- self->_refcount++;
- if (self->_refcount == 1 && self->_lastDispatch != nil) {
- self->_lastDispatch = nil;
- }
- });
+ _refcount++;
+ if (_refcount == 1 && _lastDispatch != nil) {
+ _lastDispatch = nil;
+ }
}
- (void)unref {
+ NSLog(@"unref");
dispatch_async(_dispatchQueue, ^{
GRPCAssert(self->_refcount > 0, NSInternalInconsistencyException, @"Illegal reference count.");
self->_refcount--;