address comments 2

pull/17578/head
Muxi Yan 6 years ago
parent d4fa274bf2
commit 121e04bc1e
  1. 1
      src/objective-c/GRPCClient/GRPCCall.m
  2. 7
      src/objective-c/RxLibrary/GRXForwardingWriter.m

@ -56,7 +56,6 @@ const char *kCFStreamVarName = "grpc_cfstream";
// Make them read-write. // Make them read-write.
@property(atomic, strong) NSDictionary *responseHeaders; @property(atomic, strong) NSDictionary *responseHeaders;
@property(atomic, strong) NSDictionary *responseTrailers; @property(atomic, strong) NSDictionary *responseTrailers;
@property(atomic) BOOL isWaitingForToken;
- (instancetype)initWithHost:(NSString *)host - (instancetype)initWithHost:(NSString *)host
path:(NSString *)path path:(NSString *)path

@ -72,7 +72,11 @@
#pragma mark GRXWriter implementation #pragma mark GRXWriter implementation
- (GRXWriterState)state { - (GRXWriterState)state {
return _writer ? _writer.state : GRXWriterStateFinished; GRXWriter *copiedWriter;
@synchronized(self) {
copiedWriter = _writer;
}
return copiedWriter ? copiedWriter.state : GRXWriterStateFinished;
} }
- (void)setState:(GRXWriterState)state { - (void)setState:(GRXWriterState)state {
@ -106,6 +110,7 @@
@synchronized(self) { @synchronized(self) {
[self finishOutputWithError:errorOrNil]; [self finishOutputWithError:errorOrNil];
copiedWriter = _writer; copiedWriter = _writer;
_writer = nil;
} }
copiedWriter.state = GRXWriterStateFinished; copiedWriter.state = GRXWriterStateFinished;
} }

Loading…
Cancel
Save