diff options
author | vjpai <vpai@google.com> | 2015-03-16 23:58:44 -0700 |
---|---|---|
committer | vjpai <vpai@google.com> | 2015-03-17 00:39:18 -0700 |
commit | 7aadf46fdb05b5f595440c41998023e69e1700e5 (patch) | |
tree | 549b9c05238f155657f4cf3d87bfbdd7c45d682b /include/grpc++/completion_queue.h | |
parent | c41bf3cb5a497ee2a6ab9a9b959587a4e56328ed (diff) |
Change to std::chrono and add a test.
Diffstat (limited to 'include/grpc++/completion_queue.h')
-rw-r--r-- | include/grpc++/completion_queue.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/grpc++/completion_queue.h b/include/grpc++/completion_queue.h index 4181911b58..d742d85ef7 100644 --- a/include/grpc++/completion_queue.h +++ b/include/grpc++/completion_queue.h @@ -34,7 +34,7 @@ #ifndef GRPCXX_COMPLETION_QUEUE_H #define GRPCXX_COMPLETION_QUEUE_H -#include <grpc/support/time.h> +#include <chrono> #include <grpc++/impl/client_unary_call.h> struct grpc_completion_queue; @@ -81,12 +81,15 @@ class CompletionQueue { // Nonblocking (until deadline) read from queue. // Cannot rely on result of tag or ok if return is TIMEOUT - NextStatus AsyncNext(void **tag, bool *ok, gpr_timespec deadline); + NextStatus AsyncNext(void **tag, bool *ok, + std::chrono::system_clock::time_point deadline); // Blocking (until deadline) read from queue. // Returns false if the queue is ready for destruction, true if event bool Next(void **tag, bool *ok) { - return (AsyncNext(tag,ok,gpr_inf_future) != SHUTDOWN); + return (AsyncNext(tag,ok, + std::chrono::system_clock::time_point::max()) != + SHUTDOWN); } // Shutdown has to be called, and the CompletionQueue can only be |