aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Muxi Yan <muxi@users.noreply.github.com>2018-05-23 18:03:58 -0700
committerGravatar GitHub <noreply@github.com>2018-05-23 18:03:58 -0700
commita4f7d99631ac1bb5f49bb2dcf3aeaae16f0da66b (patch)
treee21e4fa082e0b817b2465f829f441da22828efb6 /src
parentc38745833ae68f4d9a597c30f6ed16542e915cf9 (diff)
parent7e5cfc2ab329a068bca8b214630ef86e4c715177 (diff)
Merge pull request #13180 from muxi/fix-objc-msan
Fix threading problem in gRPC ObjC
Diffstat (limited to 'src')
-rw-r--r--src/objective-c/GRPCClient/GRPCCall.m6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m
index 75dda9df85..5b48d06158 100644
--- a/src/objective-c/GRPCClient/GRPCCall.m
+++ b/src/objective-c/GRPCClient/GRPCCall.m
@@ -268,8 +268,10 @@ static NSString *const kBearerPrefix = @"Bearer ";
// method.
// TODO(jcanizales): Rename to readResponseIfNotPaused.
- (void)startNextRead {
- if (self.state == GRXWriterStatePaused) {
- return;
+ @synchronized(self) {
+ if (self.state == GRXWriterStatePaused) {
+ return;
+ }
}
dispatch_async(_callQueue, ^{