mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
SafeThread: Simplify m_lock assignment. (#49)
Instead of construct-and-swap, just use the move operator=.
This commit is contained in:
@@ -34,7 +34,7 @@ class SafeThreadProxyBase {
|
||||
public:
|
||||
SafeThreadProxyBase(SafeThread* thr) : m_thread(thr) {
|
||||
if (!m_thread) return;
|
||||
std::unique_lock<std::mutex>(m_thread->m_mutex).swap(m_lock);
|
||||
m_lock = std::unique_lock<std::mutex>(m_thread->m_mutex);
|
||||
if (!m_thread->m_active) {
|
||||
m_lock.unlock();
|
||||
m_thread = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user