mirror of https://github.com/AxioDL/jbus.git
Listener: Use C++17 deduction guides for mutex locks
Same thing, but without hardcoding the mutex type.
This commit is contained in:
parent
dff87c2c6a
commit
4538b20e73
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue