From 4c41cb1f715c7f1dd25cb9cd3f85add45889ae92 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 19 Jul 2021 15:03:02 +0200 Subject: [PATCH] update to upstream --- src/osal/host/QueueMapManager.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/osal/host/QueueMapManager.cpp b/src/osal/host/QueueMapManager.cpp index ad39972f..58575cf6 100644 --- a/src/osal/host/QueueMapManager.cpp +++ b/src/osal/host/QueueMapManager.cpp @@ -24,7 +24,13 @@ QueueMapManager* QueueMapManager::instance() { ReturnValue_t QueueMapManager::addMessageQueue( MessageQueueIF* queueToInsert, MessageQueueId_t* id) { MutexGuard lock(mapLock); - uint32_t currentId = queueCounter++; + uint32_t currentId = queueCounter; + queueCounter++; + if(currentId == MessageQueueIF::NO_QUEUE) { + // Skip the NO_QUEUE value + currentId = queueCounter; + queueCounter++; + } auto returnPair = queueMap.emplace(currentId, queueToInsert); if(not returnPair.second) { /* This should never happen for the atomic variable. */