notify inside lock

pull/2656/head
yang-g 10 years ago
parent 19e9c09700
commit 3d769d7f23
  1. 8
      test/cpp/interop/reconnect_interop_server.cc

@ -116,8 +116,8 @@ class ReconnectServiceImpl : public ReconnectService::Service {
{
std::lock_guard<std::mutex> lock(mu_);
serving_ = false;
cv_.notify_one();
}
cv_.notify_one();
return Status::OK;
}
@ -147,10 +147,8 @@ class ReconnectServiceImpl : public ReconnectService::Service {
}
void Shutdown() {
{
std::lock_guard<std::mutex> lock(mu_);
shutdown_ = true;
}
std::lock_guard<std::mutex> lock(mu_);
shutdown_ = true;
cv_.notify_all();
}

Loading…
Cancel
Save