Ejemplo n.º 1
0
        void run ()
        {
            TScopedLock  del_lock( _del_mutex );

            while ( ! _end )
            {

                _pool->append_idle( this );

                {
                    TScopedLock  work_lock( _work_cond );

                    while (( _job == NULL ) && ! _end )
                        _work_cond.wait();
                }



                if ( _job != NULL )
                {
                    _job->run( _data_ptr );
                    _job->unlock();

                    if ( _del_job )
                        delete _job;

                    TScopedLock  work_lock( _work_cond );

                    _job      = NULL;
                    _data_ptr = NULL;
                }
            }
        }
Ejemplo n.º 2
0
    void run ()
	{
	    _del_mutex.lock();

	    while ( ! _end )
	    {

            _pool->append_idle( this );

            _work_cond.lock();

            while (( _job == NULL ) && ! _end )
                _work_cond.wait();

            _work_cond.unlock();

            if ( _job != NULL )
            {
                _job->run( _data_ptr );
                _job->unlock();

                if ( _del_job )
                    delete _job;

                _work_cond.lock();
                _job      = NULL;
                _data_ptr = NULL;
                _work_cond.unlock();
            }
	    }

	    _del_mutex.unlock();
	}