fixed race condition

This commit is contained in:
Jeff Hill
2001-09-25 00:13:20 +00:00
parent 0768bb9764
commit c7a82c3ce2
2 changed files with 12 additions and 13 deletions

View File

@@ -36,14 +36,20 @@ epicsMutex dbSubscriptionIO::freeListMutex;
dbSubscriptionIO::dbSubscriptionIO ( dbServiceIO &serviceIO, dbChannelIO &chanIO,
dbAddr &addr, cacStateNotify &notifyIn,
unsigned typeIn, unsigned long countIn, unsigned maskIn,
cacChannel::ioid * pId ) :
cacChannel::ioid * pId ) :
notify ( notifyIn ), chan ( chanIO ), es ( 0 ),
type ( typeIn ), count ( countIn ), id ( 0u )
{
this->es = serviceIO.subscribe ( addr, chanIO, *this, maskIn, pId );
this->es = serviceIO.subscribe ( addr, chanIO, *this, maskIn );
if ( ! this->es ) {
throw std::bad_alloc ();
}
if ( pId ) {
*pId = this->getId ();
}
db_post_single_event ( this->es );
}
dbSubscriptionIO::~dbSubscriptionIO ()