aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2019-01-09 15:22:05 -0800
committerGravatar Muxi Yan <mxyan@google.com>2019-01-09 15:22:05 -0800
commit121e04bc1e44bb684d464be6788f1c0a065b1116 (patch)
tree4c53ba9391bfe53aaaf80a796e942e0910150b08
parentd4fa274bf2994276341e47920aa46e7a009b4d10 (diff)
address comments 2
-rw-r--r--src/objective-c/GRPCClient/GRPCCall.m1
-rw-r--r--src/objective-c/RxLibrary/GRXForwardingWriter.m7
2 files changed, 6 insertions, 2 deletions
diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m
index c0d10cacc1..e8fae09a1f 100644
--- a/src/objective-c/GRPCClient/GRPCCall.m
+++ b/src/objective-c/GRPCClient/GRPCCall.m
@@ -56,7 +56,6 @@ const char *kCFStreamVarName = "grpc_cfstream";
// Make them read-write.
@property(atomic, strong) NSDictionary *responseHeaders;
@property(atomic, strong) NSDictionary *responseTrailers;
-@property(atomic) BOOL isWaitingForToken;
- (instancetype)initWithHost:(NSString *)host
path:(NSString *)path
diff --git a/src/objective-c/RxLibrary/GRXForwardingWriter.m b/src/objective-c/RxLibrary/GRXForwardingWriter.m
index f5ed603698..27ac0acdff 100644
--- a/src/objective-c/RxLibrary/GRXForwardingWriter.m
+++ b/src/objective-c/RxLibrary/GRXForwardingWriter.m
@@ -72,7 +72,11 @@
#pragma mark GRXWriter implementation
- (GRXWriterState)state {
- return _writer ? _writer.state : GRXWriterStateFinished;
+ GRXWriter *copiedWriter;
+ @synchronized(self) {
+ copiedWriter = _writer;
+ }
+ return copiedWriter ? copiedWriter.state : GRXWriterStateFinished;
}
- (void)setState:(GRXWriterState)state {
@@ -106,6 +110,7 @@
@synchronized(self) {
[self finishOutputWithError:errorOrNil];
copiedWriter = _writer;
+ _writer = nil;
}
copiedWriter.state = GRXWriterStateFinished;
}