Skip to content

Commit 233482f

Browse files
committed
use unique_lock instead of lock_guard
1 parent ca16657 commit 233482f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libmamba/include/mamba/core/thread_utils.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,15 +186,15 @@ namespace mamba
186186

187187
inline void counting_semaphore::lock()
188188
{
189-
std::unique_lock<std::mutex> lock(m_access_mutex);
189+
std::unique_lock lock{ m_access_mutex };
190190
m_cv.wait(lock, [&]() { return m_value > 0; });
191191
--m_value;
192192
}
193193

194194
inline void counting_semaphore::unlock()
195195
{
196196
{
197-
std::lock_guard<std::mutex> lock(m_access_mutex);
197+
std::lock_guard lock{ m_access_mutex };
198198
if (++m_value <= 0)
199199
{
200200
return;

0 commit comments

Comments
 (0)