mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-03 03:22:30 +02:00
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.
This commit is contained in:
parent
57454e90a7
commit
ebf3de4d93
@ -58,7 +58,7 @@ DolphinAnalytics::DolphinAnalytics()
|
|||||||
|
|
||||||
std::shared_ptr<DolphinAnalytics> DolphinAnalytics::Instance()
|
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)
|
if (!s_instance)
|
||||||
{
|
{
|
||||||
s_instance.reset(new DolphinAnalytics());
|
s_instance.reset(new DolphinAnalytics());
|
||||||
@ -68,7 +68,7 @@ std::shared_ptr<DolphinAnalytics> DolphinAnalytics::Instance()
|
|||||||
|
|
||||||
void DolphinAnalytics::ReloadConfig()
|
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.
|
// Install the HTTP backend if analytics support is enabled.
|
||||||
std::unique_ptr<Common::AnalyticsReportingBackend> new_backend;
|
std::unique_ptr<Common::AnalyticsReportingBackend> new_backend;
|
||||||
|
@ -76,7 +76,7 @@ public:
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
void Send(T report)
|
void Send(T report)
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lk(m_reporter_mutex);
|
std::lock_guard lk{m_reporter_mutex};
|
||||||
m_reporter.Send(report);
|
m_reporter.Send(report);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user