Esempio n. 1
0
bool Channel::syncConfigInit()
{
    EQASSERT( _state == STATE_INITIALIZING || _state == STATE_INIT_SUCCESS ||
              _state == STATE_INIT_FAILED );

    _state.waitNE( STATE_INITIALIZING );

    if( _state == STATE_INIT_SUCCESS )
    {
        _state = STATE_RUNNING;
        return true;
    }

    configExit();
    return false;
}
Esempio n. 2
0
bool Pipe::syncConfigInit()
{
    EQASSERT( _state == STATE_INITIALIZING || _state == STATE_INIT_SUCCESS ||
              _state == STATE_INIT_FAILED );

    _state.waitNE( STATE_INITIALIZING );

    if( _state == STATE_INIT_SUCCESS )
    {
        _state = STATE_RUNNING;
        return true;
    }

    EQWARN << "Pipe initialization failed: " << getError() << std::endl;
    configExit();
    return false;
}
Esempio n. 3
0
bool Window::syncConfigInit()
{
    EQASSERT( !needsDelete( ));
    EQASSERT( _state == STATE_INITIALIZING || _state == STATE_INIT_SUCCESS ||
              _state == STATE_INIT_FAILED );

    _state.waitNE( STATE_INITIALIZING );

    if( _state == STATE_INIT_SUCCESS )
    {
        _state = STATE_RUNNING;
        return true;
    }

    configExit();
    return false;
}
Esempio n. 4
0
bool Pipe::_cmdConfigExit( co::ICommand& cmd )
{
    co::ObjectICommand command( cmd );

    LB_TS_THREAD( _pipeThread );
    LBLOG( LOG_INIT ) << "TASK pipe config exit " << command << std::endl;

    _impl->state = STATE_STOPPING; // needed in View::detach (from _flushViews)

    // send before node gets a chance to send its destroy command
    getNode()->send( getLocalNode(), fabric::CMD_NODE_DESTROY_PIPE ) << getID();

    // Flush views before exit since they are created after init
    // - application may need initialized pipe to exit
    // - configExit can't access views since all channels are gone already
    _flushViews();
    _flushQueues();
    _impl->state = configExit() ? STATE_STOPPED : STATE_FAILED;
    return true;
}
Esempio n. 5
0
bool Window::_cmdConfigExit( co::ICommand& cmd )
{
    co::ObjectICommand command( cmd );

    LBLOG( LOG_INIT ) << "TASK window config exit " << command << std::endl;

    if( _state != STATE_STOPPED )
    {
        if( getPipe()->isRunning( ) && _systemWindow )
        {
            makeCurrent();
            getPipe()->flushFrames( _objectManager );
        }
        // else emergency exit, no context available.

        _state = configExit() ? STATE_STOPPED : STATE_FAILED;
    }

    getPipe()->send( getLocalNode(),
                     fabric::CMD_PIPE_DESTROY_WINDOW ) << getID();
    return true;
}
Esempio n. 6
0
bool Node::_cmdConfigExit( co::Command& command )
{
    LB_TS_THREAD( _nodeThread );
    LBLOG( LOG_INIT ) << "Node exit " 
                      << command.get<NodeConfigExitPacket>() << std::endl;

    const Pipes& pipes = getPipes();
    for( Pipes::const_iterator i = pipes.begin(); i != pipes.end(); ++i )
    {
        Pipe* pipe = *i;
        pipe->waitExited();
    }
    
    _state = configExit() ? STATE_STOPPED : STATE_FAILED;
    transmitter.getQueue().wakeup();
    transmitter.join();
    _flushObjects();

    ConfigDestroyNodePacket destroyPacket( getID( ));
    getConfig()->send( getLocalNode(), destroyPacket );
    return true;
}
Esempio n. 7
0
bool Window::_cmdConfigExit( co::Command& command )
{
    const WindowConfigExitPacket* packet =
        command.get<WindowConfigExitPacket>();
    LBLOG( LOG_INIT ) << "TASK window config exit " << packet << std::endl;

    if( _state != STATE_STOPPED )
    {
        if( getPipe()->isRunning( ) && _systemWindow )
        {
            makeCurrent();
            getPipe()->flushFrames( _objectManager );
        }
        // else emergency exit, no context available.

        _state = configExit() ? STATE_STOPPED : STATE_FAILED;
    }

    PipeDestroyWindowPacket destroyPacket( getID( ));
    getPipe()->send( getLocalNode(), destroyPacket );
    return true;
}
Esempio n. 8
0
bool Node::_cmdConfigExit( co::ICommand& cmd )
{
    co::ObjectICommand command( cmd );

    LB_TS_THREAD( _nodeThread );
    LBLOG( LOG_INIT ) << "Node exit " << command << std::endl;

    const Pipes& pipes = getPipes();
    for( PipesCIter i = pipes.begin(); i != pipes.end(); ++i )
    {
        Pipe* pipe = *i;
        pipe->waitExited();
    }

    _impl->state = configExit() ? STATE_STOPPED : STATE_FAILED;
    getTransmitterQueue()->push( co::ICommand( )); // wake up to exit
    _impl->transmitter.join();
    _flushObjects();

    getConfig()->send( getLocalNode(),
                       fabric::CMD_CONFIG_DESTROY_NODE ) << getID();
    return true;
}