From 4538b20e730553062f9e55ab68f1cb272c5f9caf Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 3 Sep 2019 10:13:27 -0400 Subject: [PATCH] Listener: Use C++17 deduction guides for mutex locks Same thing, but without hardcoding the mutex type. --- lib/Listener.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Listener.cpp b/lib/Listener.cpp index 24be0a4..ef96522 100644 --- a/lib/Listener.cpp +++ b/lib/Listener.cpp @@ -64,7 +64,7 @@ void Listener::listenerProc() { #endif } if (acceptData && acceptClock) { - std::unique_lock lk(m_queueLock); + std::unique_lock lk{m_queueLock}; m_endpointQueue.push(std::make_unique(0, std::move(acceptData), std::move(acceptClock))); } WaitGCTicks(GetGCTicksPerSec()); @@ -90,7 +90,7 @@ void Listener::stop() { } std::unique_ptr Listener::accept() { - std::unique_lock lk(m_queueLock); + std::unique_lock lk{m_queueLock}; if (m_endpointQueue.size()) { std::unique_ptr ret; ret = std::move(m_endpointQueue.front());