From 33ee0cba83dac70e4c8c0c195cb9eab25bc87a4a Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Thu, 17 Jun 2004 23:30:32 +0000 Subject: [PATCH] no need to maintain count of circuits insttalled when they are installed on a doubly linked list --- src/ca/cac.cpp | 9 ++------- src/ca/cac.h | 1 - 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/ca/cac.cpp b/src/ca/cac.cpp index 477c6959b..e5f411b70 100644 --- a/src/ca/cac.cpp +++ b/src/ca/cac.cpp @@ -137,8 +137,7 @@ cac::cac ( initializingThreadsId ( epicsThreadGetIdSelf() ), initializingThreadsPriority ( epicsThreadGetPrioritySelf() ), maxRecvBytesTCP ( MAX_TCP ), - beaconAnomalyCount ( 0u ), - circuitsInstalled ( 0u ) + beaconAnomalyCount ( 0u ) { if ( ! osiSockAttach () ) { throwWithLocation ( caErrorCode (ECA_INTERNAL) ); @@ -256,13 +255,12 @@ cac::~cac () // { epicsGuard < epicsMutex > guard ( this->mutex ); - while ( this->circuitsInstalled ) { + while ( this->circuitList.count() > 0 ) { epicsGuardRelease < epicsMutex > unguard ( guard ); this->iiuUninstall.wait (); } } - if ( this->pudpiiu ) { delete this->pudpiiu; } @@ -530,7 +528,6 @@ bool cac::transferChanToVirtCircuit ( } this->serverTable.add ( *pnewiiu ); this->circuitList.add ( *pnewiiu ); - this->circuitsInstalled++; pBHE->registerIIU ( guard, *pnewiiu ); piiu = pnewiiu.release (); newIIU = true; @@ -1172,8 +1169,6 @@ void cac::destroyIIU ( tcpiiu & iiu ) { epicsGuard < epicsMutex > guard ( this->mutex ); this->freeListVirtualCircuit.release ( & iiu ); - assert ( this->circuitsInstalled > 0u ); - this->circuitsInstalled--; } // signal iiu uninstal event so that cac can properly shut down diff --git a/src/ca/cac.h b/src/ca/cac.h index ea2ac6b16..fbcde6344 100644 --- a/src/ca/cac.h +++ b/src/ca/cac.h @@ -283,7 +283,6 @@ private: unsigned initializingThreadsPriority; unsigned maxRecvBytesTCP; unsigned beaconAnomalyCount; - unsigned circuitsInstalled; void run (); void recycleReadNotifyIO (