Ammo::Ammo( const Option* o ) : Item( o ), fired(false), form(0) { if ( o->type == bul_none ) { doPerform(aPolymorph); } else for ( int i = 0; i < NUM_ABORT; ++i ) { doPerform(aPolymorph); if ( ammoStats::AmmoStats[form].type == o->type) { break; } } }
void LLCurl::Multi::perform() { if (mThreaded) { mSignal->lock(); if (mPerformState == PERFORM_STATE_READY) { mSignal->signal(); } mSignal->unlock(); } else { doPerform(); } }
void LLCurl::Multi::run() { llassert(mThreaded); mSignal->lock(); while (!mQuitting) { mSignal->wait(); mPerformState = PERFORM_STATE_PERFORMING; if (!mQuitting) { LLMutexLock lock(LLCurl::Easy::sMultiMutex); doPerform(); } } mSignal->unlock(); }
bool LLCurl::Multi::waitToComplete() { if(!isValid()) { return true ; } if(!mMutexp) //not threaded { doPerform() ; return true ; } bool completed = (STATE_COMPLETED == mState) ; if(!completed) { LLCurl::getCurlThread()->setPriority(mHandle, LLQueuedThread::PRIORITY_HIGH) ; } return completed; }