IIUC the fix to the TX-side issue should look something like the attached patch. We don't have any tests that express the fault that this should fix, but the result does (still) pass epicsMessageQueueTest.
However I spent yesterday afternoon looking at osi/os/default/osdMessageQueue.cpp properly and I have a more extensive solution that I think fixes the remaining issues too. I wrote some tests to check the TX-side problems but unfortunately they don't seem to trigger any bugs other than possibly in the test code itself. I will put together a PR with what I have so far in case anyone else wants to take a look.
IIUC the fix to the TX-side issue should look something like the attached patch. We don't have any tests that express the fault that this should fix, but the result does (still) pass epicsMessageQue ueTest.
However I spent yesterday afternoon looking at osi/os/ default/ osdMessageQueue .cpp properly and I have a more extensive solution that I think fixes the remaining issues too. I wrote some tests to check the TX-side problems but unfortunately they don't seem to trigger any bugs other than possibly in the test code itself. I will put together a PR with what I have so far in case anyone else wants to take a look.