update to upstream

This commit is contained in:
Robin Müller 2021-07-19 15:03:02 +02:00
parent 16ed5e3270
commit 4c41cb1f71
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC

View File

@ -24,7 +24,13 @@ QueueMapManager* QueueMapManager::instance() {
ReturnValue_t QueueMapManager::addMessageQueue( 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;
queueCounter++;
if(currentId == MessageQueueIF::NO_QUEUE) {
// Skip the NO_QUEUE value
currentId = queueCounter;
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. */