ServiceController增加size方法 (#3587)

This commit is contained in:
waken 2024-06-01 18:14:52 +08:00 committed by GitHub
parent 49dfccd56f
commit 8dad1983a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -323,6 +323,11 @@ public:
return _map.erase(key);
}
size_t size() {
std::lock_guard<std::recursive_mutex> lck(_mtx);
return _map.size();
}
Pointer find(const std::string &key) const {
std::lock_guard<std::recursive_mutex> lck(_mtx);
auto it = _map.find(key);