Comment 8 for bug 1868486

Revision history for this message
Ben Franksen (bfrk) wrote :

I think the bug is to rely on the return value of epicsEventWaitWithTimeout. Try the following patch. A similar fix may be needed in function mySend.

diff --git a/modules/libcom/src/osi/os/default/osdMessageQueue.cpp b/modules/libcom/src/osi/os/default/osdMessageQueue.cpp
index c86d8cc2b..eb615a8d0 100644
--- a/modules/libcom/src/osi/os/default/osdMessageQueue.cpp
+++ b/modules/libcom/src/osi/os/default/osdMessageQueue.cpp
@@ -352,8 +352,9 @@ myReceive(epicsMessageQueueId pmsg, void *message, unsigned int size,

     epicsMutexUnlock(pmsg->mutex);

- if (threadNode.eventSent && (threadNode.size <= size) &&
- status == epicsEventOK)
+ // even if status == epicsEventTimeout it may still be that we
+ // have received a message
+ if (threadNode.eventSent && threadNode.size <= size && status != epicsEventError)
         return threadNode.size;
     return -1;
 }