示例#1
0
bool Node::_cmdConfigInit( co::Command& command )
{
    LB_TS_THREAD( _nodeThread );

    const NodeConfigInitPacket* packet = 
        command.get<NodeConfigInitPacket>();
    LBLOG( LOG_INIT ) << "Init node " << packet << std::endl;

    _state = STATE_INITIALIZING;

    _currentFrame  = packet->frameNumber;
    _unlockedFrame = packet->frameNumber;
    _finishedFrame = packet->frameNumber;
    _setAffinity();

    transmitter.start();
    setError( ERROR_NONE );
    NodeConfigInitReplyPacket reply;
    reply.result = configInit( packet->initID );

    if( getIAttribute( IATTR_THREAD_MODEL ) == eq::UNDEFINED )
        setIAttribute( IATTR_THREAD_MODEL, eq::DRAW_SYNC );

    _state = reply.result ? STATE_RUNNING : STATE_INIT_FAILED;

    commit();
    send( command.getNode(), reply );
    return true;
}
示例#2
0
文件: node.cpp 项目: VMML/Equalizer
bool Node::_cmdConfigInit( co::ICommand& cmd )
{
    co::ObjectICommand command( cmd );

    LB_TS_THREAD( _nodeThread );
    LBLOG( LOG_INIT ) << "Init node " << command << std::endl;

    _impl->state = STATE_INITIALIZING;

    const uint128_t& initID = command.read< uint128_t >();
    const uint32_t frameNumber = command.read< uint32_t >();

    _impl->currentFrame  = frameNumber;
    _impl->unlockedFrame = frameNumber;
    _impl->finishedFrame = frameNumber;
    _setAffinity();

    _impl->transmitter.start();
    const uint64_t result = configInit( initID );

    if( getIAttribute( IATTR_THREAD_MODEL ) == eq::UNDEFINED )
        setIAttribute( IATTR_THREAD_MODEL, eq::DRAW_SYNC );

    _impl->state = result ? STATE_RUNNING : STATE_INIT_FAILED;

    commit();
    send( command.getRemoteNode(), fabric::CMD_NODE_CONFIG_INIT_REPLY )
            << result;
    return true;
}