fixed logic surrounding subscription cancel
1) When channel is destroyed, but subscription not installed into a server 2) When subscription is destroyed, but has not been installed in server
This commit is contained in:
@@ -658,8 +658,7 @@ baseNMIU * cac::destroyIO (
|
||||
if ( pIO ) {
|
||||
class netSubscription * pSubscr = pIO->isSubscription ();
|
||||
if ( pSubscr ) {
|
||||
chan.getPIIU(guard)->subscriptionCancelRequest (
|
||||
guard, chan, *pSubscr );
|
||||
pSubscr->unsubscribeIfRequired ( guard, chan );
|
||||
}
|
||||
|
||||
// this uninstalls from the list and destroys the IO
|
||||
|
||||
@@ -83,15 +83,16 @@ void nciu::destroy (
|
||||
epicsGuard < epicsMutex > & callbackControlGuard,
|
||||
epicsGuard < epicsMutex > & mutualExclusionGuard )
|
||||
{
|
||||
while ( baseNMIU * pNetIO = this->eventq.first () ) {
|
||||
assert ( this->cacCtx.destroyIO (
|
||||
callbackControlGuard, mutualExclusionGuard,
|
||||
pNetIO->getId (), *this ) );
|
||||
}
|
||||
|
||||
// if the claim reply has not returned yet then we will issue
|
||||
// the clear channel request to the server when the claim reply
|
||||
// arrives and there is no matching nciu in the client
|
||||
if ( this->channelNode::isInstalledInServer ( mutualExclusionGuard ) ) {
|
||||
while ( baseNMIU * pNetIO = this->eventq.first () ) {
|
||||
assert ( this->cacCtx.destroyIO (
|
||||
callbackControlGuard, mutualExclusionGuard,
|
||||
pNetIO->getId (), *this ) );
|
||||
}
|
||||
this->getPIIU(mutualExclusionGuard)->clearChannelRequest (
|
||||
mutualExclusionGuard, this->sid, this->id );
|
||||
}
|
||||
|
||||
@@ -89,6 +89,8 @@ public:
|
||||
epicsGuard < epicsMutex > & ) const;
|
||||
void subscribeIfRequired (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan );
|
||||
void unsubscribeIfRequired (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan );
|
||||
void subscriptionUpdateIfRequired (
|
||||
epicsGuard < epicsMutex > &, nciu & );
|
||||
protected:
|
||||
|
||||
@@ -170,6 +170,16 @@ void netSubscription::subscribeIfRequired (
|
||||
}
|
||||
}
|
||||
|
||||
void netSubscription::unsubscribeIfRequired (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan )
|
||||
{
|
||||
if ( this->subscribed ) {
|
||||
chan.getPIIU(guard)->subscriptionCancelRequest (
|
||||
guard, chan, *this );
|
||||
this->subscribed = false;
|
||||
}
|
||||
}
|
||||
|
||||
void netSubscription::subscriptionUpdateIfRequired (
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user