fixed possible race condition where put notify block might be nilled out
while it is running
This commit is contained in:
@@ -47,7 +47,6 @@ public:
|
||||
void initiatePutNotify ( epicsMutex &mutex, cacWriteNotify ¬ify, struct dbAddr &addr,
|
||||
unsigned type, unsigned long count, const void *pValue );
|
||||
void cancel ();
|
||||
void completion ();
|
||||
void show ( unsigned level ) const;
|
||||
void * operator new ( size_t size );
|
||||
void operator delete ( void *pCadaver, size_t size );
|
||||
@@ -113,7 +112,6 @@ public:
|
||||
cacReadNotify ¬ify );
|
||||
void callStateNotify ( unsigned type, unsigned long count,
|
||||
const struct db_field_log *pfl, cacStateNotify ¬ify );
|
||||
void putNotifyCompletion ( dbPutNotifyBlocker & );
|
||||
void show ( unsigned level ) const;
|
||||
void * operator new ( size_t size);
|
||||
void operator delete ( void *pCadaver, size_t size );
|
||||
@@ -156,7 +154,6 @@ public:
|
||||
void initiatePutNotify ( dbChannelIO &, struct dbAddr &, unsigned type,
|
||||
unsigned long count, const void *pValue, cacWriteNotify ¬ify,
|
||||
cacChannel::ioid *pId );
|
||||
void putNotifyCompletion ( dbPutNotifyBlocker & );
|
||||
void show ( unsigned level ) const;
|
||||
void showAllIO ( const dbChannelIO &chan, unsigned level ) const;
|
||||
void destroyAllIO ( dbChannelIO & chan );
|
||||
|
||||
@@ -83,11 +83,6 @@ cacChannel::ioStatus dbChannelIO::write ( unsigned type, unsigned long count,
|
||||
return iosAsynch;
|
||||
}
|
||||
|
||||
void dbChannelIO::putNotifyCompletion ( dbPutNotifyBlocker &blocker )
|
||||
{
|
||||
this->serviceIO.putNotifyCompletion ( blocker );
|
||||
}
|
||||
|
||||
void dbChannelIO::subscribe ( unsigned type, unsigned long count,
|
||||
unsigned mask, cacStateNotify ¬ify, ioid *pId )
|
||||
{
|
||||
|
||||
@@ -88,19 +88,12 @@ extern "C" void putNotifyCompletion ( putNotify *ppn )
|
||||
}
|
||||
}
|
||||
else {
|
||||
errlogPrintf ( "put notify completion pNotify = %p?\n", pBlocker->pNotify );
|
||||
errlogPrintf ( "put notify completion with nill pNotify?\n" );
|
||||
}
|
||||
// no need to lock here because only one put notify at a timeis lalowed to run
|
||||
memset ( &pBlocker->pn, '\0', sizeof ( pBlocker->pn ) );
|
||||
pBlocker->pNotify = 0;
|
||||
pBlocker->block.signal ();
|
||||
pBlocker->chan.putNotifyCompletion ( *pBlocker );
|
||||
}
|
||||
|
||||
void dbPutNotifyBlocker::completion ()
|
||||
{
|
||||
memset ( &this->pn, '\0', sizeof ( this->pn ) );
|
||||
this->pNotify = 0;
|
||||
this->block.signal ();
|
||||
}
|
||||
|
||||
void dbPutNotifyBlocker::initiatePutNotify ( epicsMutex &mutex, cacWriteNotify ¬ify,
|
||||
|
||||
@@ -255,12 +255,6 @@ void dbServiceIO::initiatePutNotify ( dbChannelIO &chan, struct dbAddr &addr,
|
||||
}
|
||||
}
|
||||
|
||||
void dbServiceIO::putNotifyCompletion ( dbPutNotifyBlocker &blocker )
|
||||
{
|
||||
epicsAutoMutex locker ( this->mutex );
|
||||
blocker.completion ();
|
||||
}
|
||||
|
||||
void dbServiceIO::destroyAllIO ( dbChannelIO & chan )
|
||||
{
|
||||
dbSubscriptionIO *pIO;
|
||||
|
||||
Reference in New Issue
Block a user