firmed up compile time lock requirements

This commit is contained in:
Jeff Hill
2002-04-25 23:51:20 +00:00
parent 0680710841
commit 9e46188c51
2 changed files with 38 additions and 35 deletions
+10 -10
View File
@@ -731,7 +731,7 @@ bool cac::lookupChannelAndTransferToTCP (
// disconnects to prevent a race condition with the
// code below - ie we hold the callback lock here
// so a chanel cant be destroyed out from under us.
pChan->connectStateNotify ();
pChan->connectStateNotify ( cbGuard );
/*
* if less than v4.1 then the server will never
@@ -740,7 +740,7 @@ bool cac::lookupChannelAndTransferToTCP (
* their call back here
*/
if ( ! v41Ok ) {
pChan->accessRightsNotify ();
pChan->accessRightsNotify ( cbGuard );
}
}
@@ -1398,13 +1398,13 @@ bool cac::readExcep ( epicsGuard < callbackMutex > &, tcpiiu &,
return true;
}
bool cac::writeExcep ( epicsGuard < callbackMutex > &, tcpiiu &,
bool cac::writeExcep ( epicsGuard < callbackMutex > &cbLocker, tcpiiu &,
const caHdrLargeArray &hdr,
const char *pCtx, unsigned status )
{
nciu * pChan = this->chanTable.lookup ( hdr.m_available );
if ( pChan ) {
pChan->writeException ( status, pCtx,
pChan->writeException ( cbLocker, status, pCtx,
hdr.m_dataType, hdr.m_count );
}
return true;
@@ -1468,7 +1468,7 @@ bool cac::exceptionRespAction ( epicsGuard < callbackMutex > & cbMutexIn, tcpiiu
return ( this->*pStub ) ( cbMutexIn, iiu, req, pCtx, hdr.m_available );
}
bool cac::accessRightsRespAction ( epicsGuard < callbackMutex > &, tcpiiu &,
bool cac::accessRightsRespAction ( epicsGuard < callbackMutex > & cbGuard, tcpiiu &,
const caHdrLargeArray &hdr, void * /* pMsgBdy */ )
{
nciu * pChan;
@@ -1490,13 +1490,13 @@ bool cac::accessRightsRespAction ( epicsGuard < callbackMutex > &, tcpiiu &,
// deleted.
//
if ( pChan ) {
pChan->accessRightsNotify ();
pChan->accessRightsNotify ( cbGuard );
}
return true;
}
bool cac::claimCIURespAction ( epicsGuard < callbackMutex > &, tcpiiu & iiu,
bool cac::claimCIURespAction ( epicsGuard < callbackMutex > &cbGuard, tcpiiu & iiu,
const caHdrLargeArray & hdr, void * /*pMsgBdy */ )
{
nciu * pChan;
@@ -1524,7 +1524,7 @@ bool cac::claimCIURespAction ( epicsGuard < callbackMutex > &, tcpiiu & iiu,
// the callback lock is taken when a channel is unistalled or when
// is disconnected to prevent race conditions here
if ( pChan ) {
pChan->connectStateNotify ();
pChan->connectStateNotify ( cbGuard );
}
return true;
}
@@ -1554,8 +1554,8 @@ void cac::disconnectChannel ( epicsGuard < callbackMutex > & cbLocker,
chan.disconnect ( *this->pudpiiu );
this->pudpiiu->installChannel ( chan );
epicsGuardRelease < cacMutex > autoMutexRelease ( locker );
chan.connectStateNotify ();
chan.accessRightsNotify ();
chan.connectStateNotify ( cbLocker );
chan.accessRightsNotify ( cbLocker );
}
bool cac::badTCPRespAction ( epicsGuard < callbackMutex > &, tcpiiu & iiu,
+28 -25
View File
@@ -43,6 +43,7 @@
class cac;
class netiiu;
class callbackMutex;
class cacPrivateListOfIO {
public:
@@ -63,8 +64,8 @@ public:
void connect ( unsigned nativeType,
unsigned nativeCount, unsigned sid, bool v41Ok );
void connect ();
void connectStateNotify () const;
void accessRightsNotify () const;
void connectStateNotify ( epicsGuard < callbackMutex > & ) const;
void accessRightsNotify ( epicsGuard < callbackMutex > & ) const;
void disconnect ( netiiu &newiiu );
bool searchMsg ( class udpiiu & iiu, unsigned short retrySeqNumber,
unsigned & retryNoForThisChannel );
@@ -91,7 +92,8 @@ public:
arrayElementCount nativeElementCount () const;
bool connected () const;
bool previouslyConnected () const;
void writeException ( int status, const char *pContext, unsigned type, arrayElementCount count );
void writeException ( epicsGuard < callbackMutex > &,
int status, const char *pContext, unsigned type, arrayElementCount count );
cacChannel::priLev getPriority () const;
void notifyStateChangeFirstConnectInCountOfOutstandingIO ();
private:
@@ -154,7 +156,7 @@ inline void nciu::resetRetryCount ()
this->retry = 0u;
}
inline void nciu::accessRightsStateChange ( const caAccessRights &arIn )
inline void nciu::accessRightsStateChange ( const caAccessRights & arIn )
{
this->accessRightState = arIn;
}
@@ -204,6 +206,28 @@ inline netiiu * nciu::getPIIU ()
return this->piiu;
}
inline void nciu::writeException ( epicsGuard < callbackMutex > &, int status,
const char *pContext, unsigned typeIn, arrayElementCount countIn )
{
this->notify().writeException ( status, pContext, typeIn, countIn );
}
inline void nciu::accessRightsNotify ( epicsGuard < callbackMutex > & ) const
{
this->notify().accessRightsNotify ( this->accessRightState );
}
inline void nciu::connectStateNotify ( epicsGuard < callbackMutex > & ) const
{
if ( this->f_connected ) {
this->notify().connectNotify ();
}
else {
this->notify().disconnectNotify ();
}
}
inline const netiiu * nciu::getConstPIIU () const
{
return this->piiu;
@@ -219,27 +243,6 @@ inline void nciu::connectTimeoutNotify ()
this->f_connectTimeOutSeen = true;
}
inline void nciu::writeException ( int status,
const char *pContext, unsigned typeIn, arrayElementCount countIn )
{
this->notify().writeException ( status, pContext, typeIn, countIn );
}
inline void nciu::connectStateNotify () const
{
if ( this->f_connected ) {
this->notify().connectNotify ();
}
else {
this->notify().disconnectNotify ();
}
}
inline void nciu::accessRightsNotify () const
{
this->notify().accessRightsNotify ( this->accessRightState );
}
inline cacChannel::priLev nciu::getPriority () const
{
return this->priority;