fixed proper shutdown of local CA subscriptions
This commit is contained in:
@@ -72,7 +72,8 @@ public:
|
||||
dbSubscriptionIO ( dbServiceIO &, dbChannelIO &, struct dbAddr &, cacStateNotify &,
|
||||
unsigned type, unsigned long count, unsigned mask, cacChannel::ioid * );
|
||||
void destroy ();
|
||||
void channelDestroyException ();
|
||||
void unsubscribe ();
|
||||
void channelDeleteException ();
|
||||
void show ( unsigned level ) const;
|
||||
void * operator new ( size_t size );
|
||||
void operator delete ( void *pCadaver, size_t size );
|
||||
|
||||
@@ -257,6 +257,9 @@ void dbServiceIO::destroyAllIO ( dbChannelIO & chan )
|
||||
while ( ( pIO = chan.dbServicePrivateListOfIO::eventq.get() ) ) {
|
||||
this->ioTable.remove ( *pIO );
|
||||
tmp.add ( *pIO );
|
||||
// this prevents a db event callback from coming
|
||||
// through after the IO is deleted
|
||||
pIO->unsubscribe ();
|
||||
}
|
||||
if ( chan.dbServicePrivateListOfIO::pBlocker ) {
|
||||
this->ioTable.remove ( *chan.dbServicePrivateListOfIO::pBlocker );
|
||||
@@ -265,7 +268,7 @@ void dbServiceIO::destroyAllIO ( dbChannelIO & chan )
|
||||
while ( ( pIO = tmp.get() ) ) {
|
||||
// If they call ioCancel() here it will be ignored
|
||||
// because the IO has been unregistered above
|
||||
pIO->channelDestroyException ();
|
||||
pIO->channelDeleteException ();
|
||||
pIO->destroy ();
|
||||
}
|
||||
if ( chan.dbServicePrivateListOfIO::pBlocker ) {
|
||||
|
||||
@@ -64,7 +64,16 @@ void dbSubscriptionIO::destroy ()
|
||||
delete this;
|
||||
}
|
||||
|
||||
void dbSubscriptionIO::channelDestroyException ()
|
||||
// lock should be applied
|
||||
void dbSubscriptionIO::unsubscribe ()
|
||||
{
|
||||
if ( this->es ) {
|
||||
db_cancel_event ( this->es );
|
||||
this->es = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void dbSubscriptionIO::channelDeleteException ()
|
||||
{
|
||||
this->notify.exception ( ECA_CHANDESTROY,
|
||||
this->chan.pName(), this->type, this->count );
|
||||
|
||||
Reference in New Issue
Block a user