From c9ead29f44708b6e312e52b364000d7e20ea0776 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 12 Nov 2017 20:10:55 -0800 Subject: [PATCH] SafeThread: Simplify m_lock assignment. (#49) Instead of construct-and-swap, just use the move operator=. --- src/main/native/include/support/SafeThread.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/native/include/support/SafeThread.h b/src/main/native/include/support/SafeThread.h index 0f39bc6811..cad4cdb3b5 100644 --- a/src/main/native/include/support/SafeThread.h +++ b/src/main/native/include/support/SafeThread.h @@ -34,7 +34,7 @@ class SafeThreadProxyBase { public: SafeThreadProxyBase(SafeThread* thr) : m_thread(thr) { if (!m_thread) return; - std::unique_lock(m_thread->m_mutex).swap(m_lock); + m_lock = std::unique_lock(m_thread->m_mutex); if (!m_thread->m_active) { m_lock.unlock(); m_thread = nullptr;