From the lock of the example in the AbstractFIFO docs, it always tells the FIFO that it used all available slots. Is that wrong? Shouldn’t it be just the slots that were actually used? In my version, I’ve been saying how much I actually wrote - is that wrong?
Bruce
[code]void addToFifo (const int* someData, int numItems)
{
int start1, size1, start2, size2;
prepareToWrite (numItems, start1, size1, start2, size2);
if (size1 > 0)
copySomeData (myBuffer + start1, someData, size1);
if (size2 > 0)
copySomeData (myBuffer + start2, someData + size1, size2);
finishedWrite (size1 + size2);
}[/code]
EDIT: in my case, if there was room for my one item, I end up doing finishedWrite (1);