Skip to content
Snippets Groups Projects
Commit bb3e7e67 authored by benjamin.franksen's avatar benjamin.franksen
Browse files

seq: fixed a corner case in ASYNC put/get

If epicsEventTryWait succeeds, there could still be a previous request
pending that has timed out. This happens e.g. if the user code did not
call pvGetComplete resp. pvPutComplete. In that case we must reset the
request pointer to NULL in order to invalidate the request so it gets
ignored whenever it finally arrives.
parent 9d8e1bbe
No related branches found
No related tags found
No related merge requests found
......@@ -120,6 +120,12 @@ epicsShareFunc pvStat epicsShareAPI seq_pvGet(SS_ID ss, VAR_ID varId, enum compT
switch (epicsEventTryWait(getSem))
{
case epicsEventWaitOK:
if (ss->getReq[varId] != NULL)
{
/* previous request timed out but user
did not call pvGetComplete */
ss->getReq[varId] = NULL;
}
status = check_connected(dbch, meta);
if (status) return epicsEventSignal(getSem), status;
break;
......@@ -392,6 +398,12 @@ epicsShareFunc pvStat epicsShareAPI seq_pvPut(SS_ID ss, VAR_ID varId, enum compT
switch (epicsEventTryWait(putSem))
{
case epicsEventWaitOK:
if (ss->putReq[varId] != NULL)
{
/* previous request timed out but user
did not call pvPutComplete */
ss->putReq[varId] = NULL;
}
break;
case epicsEventWaitTimeout:
meta->status = pvStatERROR;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment