From 008f6df9b2b150f7cd85d457645f4405fd95d4b1 Mon Sep 17 00:00:00 2001 From: typhoonzero Date: Mon, 30 Apr 2018 08:06:30 +0800 Subject: [PATCH] update --- paddle/fluid/operators/detail/grpc_server.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/paddle/fluid/operators/detail/grpc_server.cc b/paddle/fluid/operators/detail/grpc_server.cc index 92819ff9581..ee3b3e3ccbd 100644 --- a/paddle/fluid/operators/detail/grpc_server.cc +++ b/paddle/fluid/operators/detail/grpc_server.cc @@ -208,6 +208,11 @@ void AsyncGRPCServer::WaitClientGet(int count) { } } +bool AsyncGRPCServer::WaitServerReady() { + std::unique_lock lock(this->mutex_ready_); + condition_ready_.wait(lock, [&] { return this->ready_ == 1; }); +} + void AsyncGRPCServer::RunSyncUpdate() { ::grpc::ServerBuilder builder; builder.AddListeningPort(address_, ::grpc::InsecureServerCredentials(), -- GitLab