Merge branch 'gitee-master' into gitlab-upstream

This commit is contained in:
zhengshuxin 2024-08-19 17:22:28 +08:00
commit 382471a74b

View File

@ -283,10 +283,12 @@ void connect_pool::put(connect_client* conn, bool keep /* = true */)
}
if (check_inter_ >= 0 && now - last_check_ >= check_inter_) {
(void) check_idle(false, false);
(void) time(&last_check_);
lock_.unlock();
(void) check_idle(false, true);
} else {
lock_.unlock();
}
lock_.unlock();
}
void connect_pool::refer()
@ -340,6 +342,8 @@ size_t connect_pool::check_idle(time_t ttl, bool kick_dead, bool exclusive)
lock_.lock();
}
(void) time(&last_check_);
if (pool_.empty() && min_ == 0) {
if (exclusive) {
lock_.unlock();