aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Greg Haines <gresrun@gmail.com>2016-03-04 13:10:26 -0800
committerGravatar Greg Haines <gresrun@gmail.com>2016-03-04 13:10:26 -0800
commitaaf66a9981a658b62be005ac5e04d704545ab2da (patch)
tree4596370085fdfeb9295a523f01de152deec7e7dc /src
parent91bd627de4fb1ab1b8c31a915d4a91ccdcf72bbe (diff)
Add comments and feature flag.
Diffstat (limited to 'src')
-rw-r--r--src/objective-c/GRPCClient/private/GRPCCompletionQueue.m6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCCompletionQueue.m b/src/objective-c/GRPCClient/private/GRPCCompletionQueue.m
index ffbb14374d..b7d5af67d9 100644
--- a/src/objective-c/GRPCClient/private/GRPCCompletionQueue.m
+++ b/src/objective-c/GRPCClient/private/GRPCCompletionQueue.m
@@ -69,7 +69,11 @@ const int64_t kGRPCCompletionQueueDefaultTimeoutSecs = 60;
gDefaultConcurrentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
});
dispatch_async(gDefaultConcurrentQueue, ^{
- gpr_timespec deadline = gpr_time_from_seconds(timeoutSecs, GPR_CLOCK_REALTIME);
+ // Using a non-infinite deadline to re-enter grpc_completion_queue_next()
+ // alleviates https://github.com/grpc/grpc/issues/5593
+ gpr_timespec deadline = (timeoutSecs < 0)
+ ? gpr_inf_future(GPR_CLOCK_REALTIME)
+ : gpr_time_from_seconds(timeoutSecs, GPR_CLOCK_REALTIME);
while (YES) {
// The following call blocks until an event is available or the deadline elapses.
grpc_event event = grpc_completion_queue_next(unmanagedQueue, deadline, NULL);