コード例 #1
0
ファイル: thread.cpp プロジェクト: ferol/Lunchbox
void Thread::_runChild()
{
    setName( className( this ));
    pinCurrentThread();
    _impl->id._impl->pthread = pthread_self();

    if( !init( ))
    {
        LBWARN << "Thread " << className( this ) << " failed to initialize"
               << std::endl;
        _impl->state = STATE_STOPPED;
        pthread_exit( 0 );
        LBUNREACHABLE;
    }

    _impl->state = STATE_RUNNING;
    LBINFO << "Thread " << className( this ) << " successfully initialized"
           << std::endl;

    run();
    LBINFO << "Thread " << className( this ) << " finished" << std::endl;
    this->exit();

    LBUNREACHABLE;
}
コード例 #2
0
ファイル: thread.cpp プロジェクト: yarda/Lunchbox
void Thread::_runChild()
{
    setName( boost::lexical_cast< std::string >( _impl->index ));
    pinCurrentThread();
    _impl->id._impl->pthread = pthread_self();

    if( !init( ))
    {
        LBWARN << "Thread " << className( this ) << " failed to initialize"
               << std::endl;
        _impl->state = STATE_STOPPED;
        pthread_exit( 0 );
        LBUNREACHABLE;
    }

    _impl->state = STATE_RUNNING;
    LBINFO << "Thread #" << _impl->index << " type " << className( *this )
           << " successfully initialized" << std::endl;

    run();
    LBVERB << "Thread " << className( this ) << " finished" << std::endl;
    this->exit();

    LBUNREACHABLE;
}