From 15adcd24bec1d8322d4f4011b7cb2a9df56cca0d Mon Sep 17 00:00:00 2001 From: alex85k Date: Wed, 4 Jun 2014 18:01:48 +0600 Subject: [PATCH] Remove extra mutex unlocking in ConcurrentQueue.h As discussed in https://github.com/DennisOSRM/Project-OSRM/pull/998 , unlocking the mutex is performed on destruction. Second unlocking gives an assertion (for debug version) for Windows and FreeBSD 10. --- DataStructures/ConcurrentQueue.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/DataStructures/ConcurrentQueue.h b/DataStructures/ConcurrentQueue.h index 28ebe9736..9d5b366f9 100644 --- a/DataStructures/ConcurrentQueue.h +++ b/DataStructures/ConcurrentQueue.h @@ -46,7 +46,6 @@ template class ConcurrentQueue [this] { return m_internal_queue.size() < m_internal_queue.capacity(); }); m_internal_queue.push_back(data); - m_mutex.unlock(); m_not_empty.notify_one(); } @@ -60,7 +59,6 @@ template class ConcurrentQueue { return !m_internal_queue.empty(); }); popped_value = m_internal_queue.front(); m_internal_queue.pop_front(); - m_mutex.unlock(); m_not_full.notify_one(); } @@ -73,7 +71,6 @@ template class ConcurrentQueue } popped_value = m_internal_queue.front(); m_internal_queue.pop_front(); - m_mutex.unlock(); m_not_full.notify_one(); return true; }