repeaterSubscribeTimer.patch from lp:1479316

This commit is contained in:
Ambroz Bizjak
2015-08-18 14:24:10 -04:00
committed by Michael Davidsaver
parent 050b9f9a48
commit b6fbea9610
4 changed files with 11 additions and 5 deletions

View File

@@ -66,6 +66,8 @@ void repeaterSubscribeTimer::shutdown (
epicsTimerNotify::expireStatus repeaterSubscribeTimer::
expire ( const epicsTime & /* currentTime */ )
{
epicsGuard < epicsMutex > guard ( this->stateMutex );
static const unsigned nTriesToMsg = 50;
if ( this->attempts > nTriesToMsg && ! this->once ) {
callbackManager mgr ( this->ctxNotify, this->cbMutex );
@@ -90,14 +92,17 @@ epicsTimerNotify::expireStatus repeaterSubscribeTimer::
}
}
void repeaterSubscribeTimer::show ( unsigned /* level */ ) const
void repeaterSubscribeTimer::show ( unsigned /* level */ )
{
epicsGuard < epicsMutex > guard ( this->stateMutex );
::printf ( "repeater subscribe timer: attempts=%u registered=%u once=%u\n",
this->attempts, this->registered, this->once );
}
void repeaterSubscribeTimer::confirmNotify ()
{
epicsGuard < epicsMutex > guard ( this->stateMutex );
this->registered = true;
}

View File

@@ -64,12 +64,13 @@ public:
epicsGuard < epicsMutex > & cbGuard,
epicsGuard < epicsMutex > & guard );
void confirmNotify ();
void show ( unsigned level ) const;
void show ( unsigned level );
private:
epicsTimer & timer;
repeaterTimerNotify & iiu;
epicsMutex & cbMutex;
cacContextNotify & ctxNotify;
epicsMutex stateMutex;
unsigned attempts;
bool registered;
bool once;

View File

@@ -1084,7 +1084,7 @@ bool udpiiu :: datagramFlush (
return true;
}
void udpiiu :: show ( unsigned level ) const
void udpiiu :: show ( unsigned level )
{
epicsGuard < epicsMutex > guard ( this->cacMutex );
@@ -1095,7 +1095,7 @@ void udpiiu :: show ( unsigned level ) const
::printf ( "Search Destination List with %u items\n",
_searchDestList.count () );
if ( level > 2u ) {
tsDLIterConst < SearchDest > iter (
tsDLIter < SearchDest > iter (
_searchDestList.firstIter () );
while ( iter.valid () )
{

View File

@@ -108,7 +108,7 @@ public:
epicsGuard < epicsMutex > & guard );
void shutdown ( epicsGuard < epicsMutex > & cbGuard,
epicsGuard < epicsMutex > & guard );
void show ( unsigned level ) const;
void show ( unsigned level );
// exceptions
class noSocket {};