From 7f82264a61ffab932e733efc0c6f649b0ce11874 Mon Sep 17 00:00:00 2001 From: Ron Sluiter Date: Wed, 12 May 2010 13:22:05 +0000 Subject: [PATCH] Added lock/unlock around MAXnetPoller() flush and read calls. --- motorApp/OmsSrc/drvMAXnetAsyn.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/motorApp/OmsSrc/drvMAXnetAsyn.cc b/motorApp/OmsSrc/drvMAXnetAsyn.cc index b5e9d235..c83f198d 100644 --- a/motorApp/OmsSrc/drvMAXnetAsyn.cc +++ b/motorApp/OmsSrc/drvMAXnetAsyn.cc @@ -874,12 +874,16 @@ static void MAXnetPoller(MAXnetController *pController) waiting may be interrupted by pollEvent */ epicsTimeGetCurrent(&now); timeToWait = timeout - epicsTimeDiffInSeconds(&now, &loopStart); + pasynManager->lockPort(pController->pasynUserSyncIO); pController->pasynOctet->flush(pController->octetPvt, pController->pasynUser); + pasynManager->unlockPort(pController->pasynUserSyncIO); while ( timeToWait > 0){ /* reading with bufferlength 0 and timeout 0.0 triggers a callback and * poll event if a notification is outstanding */ + pasynManager->lockPort(pController->pasynUserSyncIO); status = pController->pasynOctet->read(pController->octetPvt, pController->pasynUser, inputBuffer, 0, &nRead, &eomReason); + pasynManager->unlockPort(pController->pasynUserSyncIO); if (epicsEventWaitWithTimeout(pController->pollEventId, pollWait) == epicsEventWaitOK) { if (motorMAXnetdebug > 3) asynPrint(pController->pasynUser, ASYN_TRACE_FLOW, "MAXnetPoller wakeup call received\n");