fix
This commit is contained in:
parent
df1d5e5005
commit
0b45e5c89a
@ -25,6 +25,10 @@ ReturnValue_t QueueMapManager::addMessageQueue(
|
|||||||
MessageQueueIF* queueToInsert, MessageQueueId_t* id) {
|
MessageQueueIF* queueToInsert, MessageQueueId_t* id) {
|
||||||
MutexGuard lock(mapLock);
|
MutexGuard lock(mapLock);
|
||||||
uint32_t currentId = queueCounter++;
|
uint32_t currentId = queueCounter++;
|
||||||
|
if(currentId == MessageQueueIF::NO_QUEUE) {
|
||||||
|
// Skip the NO_QUEUE value
|
||||||
|
currentId = queueCounter++;
|
||||||
|
}
|
||||||
auto returnPair = queueMap.emplace(currentId, queueToInsert);
|
auto returnPair = queueMap.emplace(currentId, queueToInsert);
|
||||||
if(not returnPair.second) {
|
if(not returnPair.second) {
|
||||||
/* This should never happen for the atomic variable. */
|
/* This should never happen for the atomic variable. */
|
||||||
|
@ -41,7 +41,8 @@ private:
|
|||||||
QueueMapManager();
|
QueueMapManager();
|
||||||
~QueueMapManager();
|
~QueueMapManager();
|
||||||
|
|
||||||
uint32_t queueCounter = 0;
|
// Start at 1 because 0 might be the NO_QUEUE value
|
||||||
|
uint32_t queueCounter = 1;
|
||||||
MutexIF* mapLock;
|
MutexIF* mapLock;
|
||||||
QueueMap queueMap;
|
QueueMap queueMap;
|
||||||
static QueueMapManager* mqManagerInstance;
|
static QueueMapManager* mqManagerInstance;
|
||||||
|
Loading…
Reference in New Issue
Block a user