diff --git a/src/ripple/core/impl/semaphore.h b/src/ripple/core/impl/semaphore.h index 4b4175251..392a0d487 100644 --- a/src/ripple/core/impl/semaphore.h +++ b/src/ripple/core/impl/semaphore.h @@ -29,8 +29,6 @@ template class basic_semaphore { private: - using scoped_lock = std::unique_lock ; - Mutex m_mutex; CondVar m_cond; std::size_t m_count; @@ -49,7 +47,7 @@ public: /** Increment the count and unblock one waiting thread. */ void notify () { - scoped_lock lock (m_mutex); + std::lock_guard lock{m_mutex}; ++m_count; m_cond.notify_one (); } @@ -57,7 +55,7 @@ public: /** Block until notify is called. */ void wait () { - scoped_lock lock (m_mutex); + std::unique_lock lock{m_mutex}; while (m_count == 0) m_cond.wait (lock); --m_count; @@ -68,7 +66,7 @@ public: */ bool try_wait () { - scoped_lock lock (m_mutex); + std::lock_guard lock{m_mutex}; if (m_count == 0) return false; --m_count;