Commit c10ea28e authored by TousakaRin's avatar TousakaRin

delete method MethodStatus::max_concurrency_ref()

parent 93ba5e32
......@@ -28,7 +28,7 @@ ConcurrencyLimiter* ConcurrencyLimiter::CreateConcurrencyLimiterOrDie(
ConcurrencyLimiter* cl_copy = cl->New();
CHECK(cl_copy != NULL) << "Fail to new ConcurrencyLimiter";
if (max_concurrency == "constant") {
cl_copy->SetMaxConcurrency(max_concurrency);
cl_copy->_max_concurrency = max_concurrency;
}
return cl_copy;
}
......
......@@ -127,22 +127,6 @@ void MethodStatus::Describe(
_nprocessing, options, false);
}
int& MethodStatus::max_concurrency_ref() {
if (NULL == _cl) {
const ConcurrencyLimiter* cl =
ConcurrencyLimiterExtension()->Find("constant");
if (NULL == cl) {
LOG(FATAL) << "Fail to find ConcurrentLimiter by `constant`";
}
ConcurrencyLimiter* cl_copy = cl->New();
if (NULL == cl_copy) {
LOG(FATAL) << "Fail to new ConcurrencyLimiter";
}
_cl = cl_copy;
}
return _cl->MaxConcurrencyRef();
}
void MethodStatus::SetConcurrencyLimiter(ConcurrencyLimiter* cl) {
if (NULL != _cl) {
_cl->Destroy();
......
......@@ -68,9 +68,8 @@ friend class ScopedMethodStatus;
friend class Server;
DISALLOW_COPY_AND_ASSIGN(MethodStatus);
// Note: Following methods are not thread safe and can only be called
// Note: SetConcurrencyLimiter() is not thread safe and can only be called
// before the server is started.
int& max_concurrency_ref();
void SetConcurrencyLimiter(ConcurrencyLimiter* cl);
ConcurrencyLimiter* _cl;
......
......@@ -49,7 +49,7 @@ public:
void RemoveConcurrency(const Controller* c) {
if (c->has_flag(Controller::FLAGS_ADDED_CONCURRENCY)){
CHECK(_server->_cl != NULL)
CHECK(_server->_cl != NULL);
_server->_cl->OnResponded(c->ErrorCode(), c->latency_us());
}
}
......
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