ca: Fix client bug (race condition) in ipAddrToAsciiEngine

This commit is contained in:
Ralph Lange
2016-05-25 12:26:32 +02:00
parent 988614ae8a
commit 23fd4e202b
5 changed files with 25 additions and 5 deletions

View File

@@ -265,12 +265,16 @@ void ipAddrToAsciiEnginePrivate::run ()
continue;
}
// fix for lp:1580623
// a destructing cac sets pCurrent to NULL, so
// make local copy to avoid race when releasing the guard
ipAddrToAsciiTransactionPrivate *pCur = this->pCurrent;
this->callbackInProgress = true;
{
epicsGuardRelease < epicsMutex > unguard ( guard );
// dont call callback with lock applied
this->pCurrent->pCB->transactionComplete ( this->nameTmp );
pCur->pCB->transactionComplete ( this->nameTmp );
}
this->callbackInProgress = false;