diff --git a/net/grpc/gateway/runtime/grpc_event_queue.cc b/net/grpc/gateway/runtime/grpc_event_queue.cc index 9c3db5a..812abc2 100644 --- a/net/grpc/gateway/runtime/grpc_event_queue.cc +++ b/net/grpc/gateway/runtime/grpc_event_queue.cc @@ -26,27 +26,25 @@ #include "net/grpc/gateway/runtime/tag.h" #include "third_party/grpc/include/grpc/grpc.h" #include "third_party/grpc/include/grpc/support/time.h" -#include "third_party/grpc/src/core/lib/gpr/thd.h" +#include "third_party/grpc/src/core/lib/gprpp/thd.h" namespace grpc { namespace gateway { GrpcEventQueue::GrpcEventQueue() - : queue_(grpc_completion_queue_create_for_next(nullptr)), thread_id_(0) {} + : queue_(grpc_completion_queue_create_for_next(nullptr)), + thread_("grpc_event_queue", ExecuteEventLoop, this) {} GrpcEventQueue::~GrpcEventQueue() {} void GrpcEventQueue::Start() { - gpr_thd_options thread_options = gpr_thd_options_default(); - gpr_thd_options_set_joinable(&thread_options); - int ret = gpr_thd_new(&thread_id_, "grpc_event_queue", ExecuteEventLoop, this, - &thread_options); - INFO("GRPC event thread started: %d", ret); + thread_.Start(); + INFO("GRPC event thread started"); } void GrpcEventQueue::Stop() { grpc_completion_queue_shutdown(queue_); - gpr_thd_join(thread_id_); + thread_.Join(); grpc_completion_queue_destroy(queue_); } diff --git a/net/grpc/gateway/runtime/grpc_event_queue.h b/net/grpc/gateway/runtime/grpc_event_queue.h index 354eabf..bfdf612 100644 --- a/net/grpc/gateway/runtime/grpc_event_queue.h +++ b/net/grpc/gateway/runtime/grpc_event_queue.h @@ -20,7 +20,7 @@ #define NET_GRPC_GATEWAY_RUNTIME_GRPC_EVENT_QUEUE_H_ #include "third_party/grpc/include/grpc/grpc.h" -#include "third_party/grpc/include/grpc/support/thd_id.h" +#include "third_party/grpc/src/core/lib/gprpp/thd.h" namespace grpc { namespace gateway { @@ -49,7 +49,7 @@ class GrpcEventQueue { grpc_completion_queue* queue_; - gpr_thd_id thread_id_; + grpc_core::Thread thread_; }; } // namespace gateway } // namespace grpc diff --git a/scripts/init_submodules.sh b/scripts/init_submodules.sh index 9657eea..78d2b7f 100755 --- a/scripts/init_submodules.sh +++ b/scripts/init_submodules.sh @@ -17,4 +17,4 @@ cd "$(dirname "$0")"/.. git submodule update --init cd third_party/closure-library && git checkout tags/v20171112 -f && cd ../.. cd third_party/openssl && git checkout tags/OpenSSL_1_0_2h -f && cd ../.. -cd third_party/grpc && git checkout 8224c45 -f && git submodule update --init && cd ../.. +cd third_party/grpc && git checkout 8b875ac -f && git submodule update --init && cd ../.. diff --git a/third_party/grpc b/third_party/grpc index 8224c45..8b875ac 160000 --- a/third_party/grpc +++ b/third_party/grpc @@ -1 +1 @@ -Subproject commit 8224c45866c6a2cfa29ede0c91a6ae9f40572658 +Subproject commit 8b875ac9413978370c4eafa2e2fb6a3b2f054297