summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-06-03 19:41:41 -0400
committerLioncash <mathew1800@gmail.com>2019-06-05 13:24:35 -0400
commitebf3de4d934b2de30e2d3f5d2e874cbecdf68e97 (patch)
tree4393c36838316d533294608f85656935ac1eb61f
parent57454e90a7c9d507a979a79474d70554727422b7 (diff)
Core/Analytics: Use std::lock_guard deduction guides
Starting with C++17, the type of the mutex being locked no longer needs to be hardcoded into the type declaration.
-rw-r--r--Source/Core/Core/Analytics.cpp4
-rw-r--r--Source/Core/Core/Analytics.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/Source/Core/Core/Analytics.cpp b/Source/Core/Core/Analytics.cpp
index 24df4af02b..ea661df38c 100644
--- a/Source/Core/Core/Analytics.cpp
+++ b/Source/Core/Core/Analytics.cpp
@@ -58,7 +58,7 @@ DolphinAnalytics::DolphinAnalytics()
std::shared_ptr<DolphinAnalytics> DolphinAnalytics::Instance()
{
- std::lock_guard<std::mutex> lk(s_instance_mutex);
+ std::lock_guard lk{s_instance_mutex};
if (!s_instance)
{
s_instance.reset(new DolphinAnalytics());
@@ -68,7 +68,7 @@ std::shared_ptr<DolphinAnalytics> DolphinAnalytics::Instance()
void DolphinAnalytics::ReloadConfig()
{
- std::lock_guard<std::mutex> lk(m_reporter_mutex);
+ std::lock_guard lk{m_reporter_mutex};
// Install the HTTP backend if analytics support is enabled.
std::unique_ptr<Common::AnalyticsReportingBackend> new_backend;
diff --git a/Source/Core/Core/Analytics.h b/Source/Core/Core/Analytics.h
index d21404a2ab..e711fe24bf 100644
--- a/Source/Core/Core/Analytics.h
+++ b/Source/Core/Core/Analytics.h
@@ -76,7 +76,7 @@ public:
template <typename T>
void Send(T report)
{
- std::lock_guard<std::mutex> lk(m_reporter_mutex);
+ std::lock_guard lk{m_reporter_mutex};
m_reporter.Send(report);
}