void disconnectGovernorTimer::shutdown (
    epicsGuard < epicsMutex > & cbGuard,
    epicsGuard < epicsMutex > & guard )
{
    {
        epicsGuardRelease < epicsMutex > unguard ( guard );
        {
            epicsGuardRelease < epicsMutex > cbUnguard ( cbGuard );
            this->timer.cancel ();
        }
    }
    while ( nciu * pChan = this->chanList.get () ) {
        pChan->channelNode::listMember = 
            channelNode::cs_none;
        pChan->serviceShutdownNotify ( cbGuard, guard );
    }
}
Example #2
0
void udpiiu::shutdown ( 
    epicsGuard < epicsMutex > & cbGuard, 
    epicsGuard < epicsMutex > & guard )
{
    // stop all of the timers
    this->repeaterSubscribeTmr.shutdown ( cbGuard, guard );
    this->govTmr.shutdown ( cbGuard, guard );
    for ( unsigned i =0; i < this->nTimers; i++ ) {
        this->ppSearchTmr[i]->shutdown ( cbGuard, guard ); 
    }

    {
        this->shutdownCmd = true;
        epicsGuardRelease < epicsMutex > unguard ( guard );
        {
            epicsGuardRelease < epicsMutex > cbUnguard ( cbGuard );

            if ( ! this->recvThread.exitWait ( 0.0 ) ) {
                unsigned tries = 0u;

                this->wakeupMsg ();

                // wait for recv threads to exit
                double shutdownDelay = 1.0;
                while ( ! this->recvThread.exitWait ( shutdownDelay ) ) {
                    this->wakeupMsg ();
                    if ( shutdownDelay < 16.0 ) {
                        shutdownDelay += shutdownDelay;
                    }
                    if ( ++tries > 3 ) {
                        fprintf ( stderr, "cac: timing out waiting for UDP thread shutdown\n" );
                    }
                }
            }
        }
    }
}
Example #3
0
void searchTimer::shutdown ( 
    epicsGuard < epicsMutex > & cbGuard,
    epicsGuard < epicsMutex > & guard )
{
    this->stopped = true;
    {
        epicsGuardRelease < epicsMutex > unguard ( guard );
        {
            epicsGuardRelease < epicsMutex > cbUnguard ( cbGuard );
            this->timer.cancel ();
        }
    }

    while ( nciu * pChan = this->chanListReqPending.get () ) {
        pChan->channelNode::listMember = 
            channelNode::cs_none;
        pChan->serviceShutdownNotify ( cbGuard, guard );
    }
    while ( nciu * pChan = this->chanListRespPending.get () ) {
        pChan->channelNode::listMember = 
            channelNode::cs_none;
        pChan->serviceShutdownNotify ( cbGuard, guard );
    }
}