Commit 52d76d46 authored by zhujiashun's avatar zhujiashun

revived_from_all_failed: add double lock

parent 6e0b8159
......@@ -57,6 +57,7 @@ bool DefaultRevivePolicy::StopRevivingIfNecessary() {
mu.unlock();
return false;
}
mu.unlock();
return true;
}
......@@ -89,7 +90,7 @@ bool DefaultRevivePolicy::DoReject(const std::vector<ServerId>& server_list) {
}
int64_t now_ms = butil::gettimeofday_ms();
int usable = GetUsableServerCount(now_ms, server_list);
{
if (_last_usable != usable) {
std::unique_lock<butil::Mutex> mu(_mutex);
if (_last_usable != usable) {
_last_usable = usable;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment