A sloppy copy/paste led me on to the fact that the queue registry can have the same queue be added twice into the xQueueRegistry array. There is also no check to compare current inserted queue names agains the queue name about to be added or any feedback that the queue about to be inserted cant be if the registry is already full. This was found in v10.2.1.
Noted, however I’m not sure we would want to update this as it would
require searching the whole registry, especially if we were to also look
for duplicate string it may not be efficient. If we do it will probably
be with a configASSERT() so the check can be used at development time only.
A couple of things to note about this. Nothing ‘breaks’ when you put a queue in the registry twice, you just waste a bit of space.
Also, and perhaps more importantly, I would very much dislike the registry rejecting adding two queue to the registry with the same name, as I frequently do this. A device driver may need multiple queue (and incoming queue, and outgoing queue, a mutex, and maybe a semaphore). You may have multiple similar devices, so you create a common driver which you initialize with parameters, including a name, which it uses on the various queues. It would be more work to make unique names for each queue used by the device, and you can usually distinguish which is which by that attributes of the queue.
Im bringing this up again as i noticed that the API has changed (in at least 10.3.1)and that the function now no longer returns if it was successful or not. ’
I find the change perplexing. How will i know if calls to vQueueAddToRegistry actually inserted into the array?
To my knowledge that API has not changed in a long time. Agree it does seem deficient in that it does not let you know if the queue was added to the registry or not.