Merge branch 'simulationCom' of ssh://dev-gitea.ftewa.ti.unibw-hamburg.de:12000/hwinkel/whisper-com into simulationCom
This commit is contained in:
@@ -26,6 +26,21 @@ namespace WHISPER {
|
|||||||
|
|
||||||
// Get the front element.
|
// Get the front element.
|
||||||
// If the queue is empty, wait till a element is avaiable.
|
// If the queue is empty, wait till a element is avaiable.
|
||||||
|
bool get(T &val)
|
||||||
|
{
|
||||||
|
std::unique_lock<std::mutex> lock(m);
|
||||||
|
if (!q.empty()) {
|
||||||
|
|
||||||
|
// auto tmp = q.front();
|
||||||
|
val = std::move(q.front());
|
||||||
|
q.pop();
|
||||||
|
return true;
|
||||||
|
}else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[[deprecated]]
|
||||||
T get(void)
|
T get(void)
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> lock(m);
|
std::unique_lock<std::mutex> lock(m);
|
||||||
|
|||||||
Reference in New Issue
Block a user