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(); }
//---------------------------------------------------------------------------- void LockThread(int lock) { static TMutex gcs; switch(lock) { case nsLockThread::eLock: gcs.lock(); break; case nsLockThread::eUnlock: gcs.unlock(); break; } }