fixed possible race condition where put notify block might be nilled out

while it is running
This commit is contained in:
Jeff Hill
2001-09-21 17:09:55 +00:00
parent c5084f15cc
commit 2e329813aa
4 changed files with 2 additions and 23 deletions

View File

@@ -47,7 +47,6 @@ public:
void initiatePutNotify ( epicsMutex &mutex, cacWriteNotify &notify, 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 &notify );
void callStateNotify ( unsigned type, unsigned long count,
const struct db_field_log *pfl, cacStateNotify &notify );
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 &notify,
cacChannel::ioid *pId );
void putNotifyCompletion ( dbPutNotifyBlocker & );
void show ( unsigned level ) const;
void showAllIO ( const dbChannelIO &chan, unsigned level ) const;
void destroyAllIO ( dbChannelIO & chan );

View File

@@ -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 &notify, ioid *pId )
{

View File

@@ -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 &notify,

View File

@@ -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;