File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,7 +73,6 @@ class PikaCmdTableManager {
7373 */
7474 std::unordered_map<std::string, CommandStatistics> cmdstat_map_;
7575 std::unordered_map<std::string, CommandStatistics> slow_command_count_;
76- std::mutex command_mutex_;
7776 std::shared_mutex histograms_mutex_;
7877 std::shared_mutex slow_command_mutex_;
7978 std::shared_ptr<prometheus::Registry> prometheus_registry_;
Original file line number Diff line number Diff line change 1515extern std::unique_ptr<PikaConf> g_pika_conf;
1616
1717void PikaCmdTableManager::ResetCommandCount () {
18- std::lock_guard<std::mutex> lock (command_mutex_);
19- slow_command_count_.clear ();
20- InitHistograms ();
18+ {
19+ std::unique_lock<std::shared_mutex> write_lock (slow_command_mutex_);
20+ slow_command_count_.clear ();
21+ }
22+
23+ {
24+ std::unique_lock<std::shared_mutex> write_lock (histograms_mutex_);
25+ InitHistograms ();
26+ }
2127}
2228
2329void PikaCmdTableManager::InitHistograms () {
You can’t perform that action at this time.
0 commit comments