diff options
author | Greg Haines <gresrun@gmail.com> | 2016-03-04 13:10:26 -0800 |
---|---|---|
committer | Greg Haines <gresrun@gmail.com> | 2016-03-04 13:10:26 -0800 |
commit | aaf66a9981a658b62be005ac5e04d704545ab2da (patch) | |
tree | 4596370085fdfeb9295a523f01de152deec7e7dc /src | |
parent | 91bd627de4fb1ab1b8c31a915d4a91ccdcf72bbe (diff) |
Add comments and feature flag.
Diffstat (limited to 'src')
-rw-r--r-- | src/objective-c/GRPCClient/private/GRPCCompletionQueue.m | 6 |
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); |