Listener: Use C++17 deduction guides for mutex locks

Same thing, but without hardcoding the mutex type.
This commit is contained in:
Lioncash 2019-09-03 10:13:27 -04:00
parent dff87c2c6a
commit 4538b20e73
1 changed files with 2 additions and 2 deletions

View File

@ -64,7 +64,7 @@ void Listener::listenerProc() {
#endif
}
if (acceptData && acceptClock) {
std::unique_lock<std::mutex> lk(m_queueLock);
std::unique_lock lk{m_queueLock};
m_endpointQueue.push(std::make_unique<Endpoint>(0, std::move(acceptData), std::move(acceptClock)));
}
WaitGCTicks(GetGCTicksPerSec());
@ -90,7 +90,7 @@ void Listener::stop() {
}
std::unique_ptr<Endpoint> Listener::accept() {
std::unique_lock<std::mutex> lk(m_queueLock);
std::unique_lock lk{m_queueLock};
if (m_endpointQueue.size()) {
std::unique_ptr<Endpoint> ret;
ret = std::move(m_endpointQueue.front());