Skip to content

Commit

Permalink
Removed C++14 scoped_lock usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsharabayko committed Jul 4, 2024
1 parent f8aee2b commit c5fa495
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions xtransmit/metrics_writer.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <thread>
#include <mutex>
#include "metrics_writer.hpp"

// submodules
Expand Down Expand Up @@ -69,7 +70,7 @@ void metrics_writer::remove_validator(SOCKET id)

void metrics_writer::clear()
{
std::lock_guard l(m_lock);
lock_guard<mutex> l(m_lock);
m_validators.clear();
}

Expand All @@ -85,7 +86,7 @@ future<void> metrics_writer::launch()
auto print_metrics = [](map<SOCKET, shared_validator>& validators, ofstream& fout, mutex& stats_lock)
{
const bool print_to_file = fout.is_open();
scoped_lock<mutex> lock(stats_lock);
lock_guard<mutex> lock(stats_lock);

for (auto& it : validators)
{
Expand Down

0 comments on commit c5fa495

Please sign in to comment.