default/epicsMessageQueue: avoid volatile flag

Only one place where eventSent was accessed
without locking.  Move this load earlier.
This commit is contained in:
Michael Davidsaver
2023-06-13 12:25:07 -07:00
parent 823386573f
commit fe4a32e425

View File

@@ -40,7 +40,7 @@ struct threadNode {
struct eventNode *evp;
void *buf;
unsigned int size;
volatile bool eventSent;
bool eventSent;
};
/*
@@ -366,9 +366,10 @@ myReceive(epicsMessageQueueId pmsg, void *message, unsigned int size,
freeEventNode(pmsg, threadNode.evp, status);
bool wasSent = threadNode.eventSent;
epicsMutexUnlock(pmsg->mutex);
if (threadNode.eventSent && (threadNode.size <= size))
if (wasSent && (threadNode.size <= size))
return threadNode.size;
return -1;
}