remove 'else' code, release lock by destructor

pull/1043/head
Ruyi Wang 10 years ago
parent 42a2e6f1b7
commit b486ba6b0d
  1. 4
      src/cpp/server/server.cc

@ -179,12 +179,12 @@ Server::Server(ThreadPoolInterface* thread_pool, bool thread_pool_owned)
thread_pool_owned_(thread_pool_owned) {} thread_pool_owned_(thread_pool_owned) {}
Server::~Server() { Server::~Server() {
{
std::unique_lock<std::mutex> lock(mu_); std::unique_lock<std::mutex> lock(mu_);
if (started_ && !shutdown_) { if (started_ && !shutdown_) {
lock.unlock(); lock.unlock();
Shutdown(); Shutdown();
} else { }
lock.unlock();
} }
grpc_server_destroy(server_); grpc_server_destroy(server_);
if (thread_pool_owned_) { if (thread_pool_owned_) {

Loading…
Cancel
Save