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.
This commit is contained in:
parent
11459d38d0
commit
15adcd24be
@ -46,7 +46,6 @@ template <typename Data> class ConcurrentQueue
|
|||||||
[this]
|
[this]
|
||||||
{ return m_internal_queue.size() < m_internal_queue.capacity(); });
|
{ return m_internal_queue.size() < m_internal_queue.capacity(); });
|
||||||
m_internal_queue.push_back(data);
|
m_internal_queue.push_back(data);
|
||||||
m_mutex.unlock();
|
|
||||||
m_not_empty.notify_one();
|
m_not_empty.notify_one();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,7 +59,6 @@ template <typename Data> class ConcurrentQueue
|
|||||||
{ return !m_internal_queue.empty(); });
|
{ return !m_internal_queue.empty(); });
|
||||||
popped_value = m_internal_queue.front();
|
popped_value = m_internal_queue.front();
|
||||||
m_internal_queue.pop_front();
|
m_internal_queue.pop_front();
|
||||||
m_mutex.unlock();
|
|
||||||
m_not_full.notify_one();
|
m_not_full.notify_one();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,7 +71,6 @@ template <typename Data> class ConcurrentQueue
|
|||||||
}
|
}
|
||||||
popped_value = m_internal_queue.front();
|
popped_value = m_internal_queue.front();
|
||||||
m_internal_queue.pop_front();
|
m_internal_queue.pop_front();
|
||||||
m_mutex.unlock();
|
|
||||||
m_not_full.notify_one();
|
m_not_full.notify_one();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user