本文整理汇总了C++中LLTimer::setTimerExpirySec方法的典型用法代码示例。如果您正苦于以下问题:C++ LLTimer::setTimerExpirySec方法的具体用法?C++ LLTimer::setTimerExpirySec怎么用?C++ LLTimer::setTimerExpirySec使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLTimer
的用法示例。
在下文中一共展示了LLTimer::setTimerExpirySec方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: haveTrackingInfo
bool LLTrackingData::haveTrackingInfo()
{
LLViewerObject* object = gObjectList.findObject(mAvatarID);
if(object && !object->isDead())
{
mCoarseLocationTimer.checkExpirationAndReset(COARSE_FREQUENCY);
mUpdateTimer.setTimerExpirySec(FIND_FREQUENCY);
mAgentGone.setTimerExpirySec(OFFLINE_SECONDS);
mHaveInfo = true;
return true;
}
if(mHaveCoarseInfo &&
!mCoarseLocationTimer.checkExpirationAndReset(COARSE_FREQUENCY))
{
// if we reach here, then we have a 'recent' coarse update
mUpdateTimer.setTimerExpirySec(FIND_FREQUENCY);
mAgentGone.setTimerExpirySec(OFFLINE_SECONDS);
return true;
}
if(mUpdateTimer.checkExpirationAndReset(FIND_FREQUENCY))
{
LLAvatarTracker::instance().findAgent();
mHaveCoarseInfo = false;
}
if(mAgentGone.checkExpirationAndReset(OFFLINE_SECONDS))
{
mHaveInfo = false;
mHaveCoarseInfo = false;
}
return mHaveInfo;
}
示例2: setTrackedCoarseLocation
void LLTrackingData::setTrackedCoarseLocation(const LLVector3d& global_pos)
{
mCoarseLocationTimer.setTimerExpirySec(COARSE_FREQUENCY);
mGlobalPositionEstimate = global_pos;
mHaveInfo = true;
mHaveCoarseInfo = true;
}
示例3: restartTimer
void LLUpdaterServiceImpl::restartTimer(unsigned int seconds)
{
LL_INFOS("UpdaterService") << "will check for update again in " <<
seconds << " seconds" << LL_ENDL;
mTimer.start();
mTimer.setTimerExpirySec((F32)seconds);
LLEventPumps::instance().obtain("mainloop").listen(
sListenerName, boost::bind(&LLUpdaterServiceImpl::onMainLoop, this, _1));
}
示例4: agentFound
void LLTrackingData::agentFound(const LLUUID& prey,
const LLVector3d& estimated_global_pos)
{
if(prey != mAvatarID)
{
llwarns << "LLTrackingData::agentFound() - found " << prey
<< " but looking for " << mAvatarID << llendl;
}
mHaveInfo = true;
mAgentGone.setTimerExpirySec(OFFLINE_SECONDS);
mGlobalPositionEstimate = estimated_global_pos;
}
示例5: pump_loop
F32 pump_loop(LLPumpIO* pump, F32 seconds)
{
LLTimer timer;
timer.setTimerExpirySec(seconds);
while(!timer.hasExpired())
{
LLFrameTimer::updateFrameTime();
pump->pump();
pump->callback();
}
return timer.getElapsedTimeF32();
}
示例6: update
//static
void LLMarketplaceInventoryImporter::update()
{
if (instanceExists())
{
static LLTimer update_timer;
if (update_timer.hasExpired())
{
LLMarketplaceInventoryImporter::instance().updateImport();
//static LLCachedControl<F32> MARKET_IMPORTER_UPDATE_FREQUENCY("MarketImporterUpdateFreq", 1.0f);
update_timer.setTimerExpirySec(MARKET_IMPORTER_UPDATE_FREQUENCY);
}
}
}
示例7: timeDelay
void timeDelay(LLCoros::self& self, LLPanelMarketplaceOutbox* outboxPanel)
{
waitForEventOn(self, "mainloop");
LLTimer delayTimer;
delayTimer.reset();
delayTimer.setTimerExpirySec(5.0f);
while (!delayTimer.hasExpired())
{
waitForEventOn(self, "mainloop");
}
outboxPanel->onSyncComplete();
gTimeDelayDebugFunc = "";
}
示例8: runThePump
void runThePump(float timeout = 100.0f)
{
LLTimer timer;
timer.setTimerExpirySec(timeout);
while(!mSawCompleted && !mSawCompletedHeader && !timer.hasExpired())
{
if (mServerPump)
{
mServerPump->pump();
mServerPump->callback();
}
if (mClientPump)
{
mClientPump->pump();
mClientPump->callback();
}
}
}
示例9: getURLToFile
// blocking asset fetch which bypasses the VFS
// this is a very limited function for use by the simstate loader and other one-offs
S32 LLHTTPAssetStorage::getURLToFile(const LLUUID& uuid, LLAssetType::EType asset_type, const LLString &url, const char *filename, progress_callback callback, void *userdata)
{
// *NOTE: There is no guarantee that the uuid and the asset_type match
// - not that it matters. - Doug
lldebugs << "LLHTTPAssetStorage::getURLToFile() - " << url << llendl;
FILE *fp = LLFile::fopen(filename, "wb"); /*Flawfinder: ignore*/
if (! fp)
{
llwarns << "Failed to open " << filename << " for writing" << llendl;
return LL_ERR_ASSET_REQUEST_FAILED;
}
// make sure we use the normal curl setup, even though we don't really need a request object
LLHTTPAssetRequest req(this, uuid, asset_type, RT_DOWNLOAD, url.c_str(), mCurlMultiHandle);
req.mFP = fp;
req.setupCurlHandle();
curl_easy_setopt(req.mCurlHandle, CURLOPT_FOLLOWLOCATION, TRUE);
curl_easy_setopt(req.mCurlHandle, CURLOPT_WRITEFUNCTION, &curlFileDownCallback);
curl_easy_setopt(req.mCurlHandle, CURLOPT_WRITEDATA, req.mCurlHandle);
curl_multi_add_handle(mCurlMultiHandle, req.mCurlHandle);
llinfos << "Requesting as file " << req.mURLBuffer << llendl;
// braindead curl loop
int queue_length;
CURLMsg *curl_msg;
LLTimer timeout;
timeout.setTimerExpirySec(GET_URL_TO_FILE_TIMEOUT);
bool success = false;
S32 xfer_result = 0;
do
{
curl_multi_perform(mCurlMultiHandle, &queue_length);
curl_msg = curl_multi_info_read(mCurlMultiHandle, &queue_length);
if (callback)
{
callback(userdata);
}
if ( curl_msg && (CURLMSG_DONE == curl_msg->msg) )
{
success = true;
}
else if (timeout.hasExpired())
{
llwarns << "Request for " << url << " has timed out." << llendl;
success = false;
xfer_result = LL_ERR_ASSET_REQUEST_FAILED;
break;
}
} while (!success);
if (success)
{
long curl_result = 0;
curl_easy_getinfo(curl_msg->easy_handle, CURLINFO_HTTP_CODE, &curl_result);
if (curl_result == HTTP_OK && curl_msg->data.result == CURLE_OK)
{
S32 size = ftell(req.mFP);
if (size > 0)
{
// everything seems to be in order
llinfos << "Success downloading " << req.mURLBuffer << " to file, size " << size << llendl;
}
else
{
llwarns << "Found " << req.mURLBuffer << " to be zero size" << llendl;
xfer_result = LL_ERR_ASSET_REQUEST_FAILED;
}
}
else
{
xfer_result = curl_result == HTTP_MISSING ? LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE : LL_ERR_ASSET_REQUEST_FAILED;
llinfos << "Failure downloading " << req.mURLBuffer <<
" with result " << curl_easy_strerror(curl_msg->data.result) << ", http result " << curl_result << llendl;
}
}
fclose(fp);
if (xfer_result)
{
LLFile::remove(filename);
}
return xfer_result;
}
示例10: execClientEvents
// Static
// Called from MAIN thread
void FLLua::execClientEvents()
{
if(!sInstance)
{
llinfos << "LUA isn't running yet." << llendl;
return;
}
if(sInstance->mPendingEvents)
{
lldebugs << __LINE__ << ": Events pending. Iterating through events." << llendl;
sInstance->mPendingEvents=false;
sInstance->lockData();
while(!sInstance->mQueuedEvents.empty())
{
#ifdef FL_PRI_EVENTS
lldebugs << __LINE__ << ": Acquiring highest-priority event." << llendl;
CB_Base *cb=sInstance->mQueuedEvents.top();
#else
lldebugs << __LINE__ << ": Acquiring first event in queue." << llendl;
CB_Base *cb=sInstance->mQueuedEvents.front();
#endif
if(!cb)
{
llwarns << "Invalid pointer to event!" << llendl;
} else {
lldebugs << __LINE__ << ": Calling event." << llendl;
cb->OnCall();
delete cb;
}
sInstance->mQueuedEvents.pop();
}
sInstance->unlockData();
}
if(sInstance->isPaused())
{
if(sInstance->mAllowPause) //shouldn't ever happen.
{
sInstance->unpause();
return;
}
int yields=0;
LLTimer timer;
timer.setTimerExpirySec(.25);
while(!sInstance->mAllowPause)//mAllowPause == true when Lua thread finishes loop.
{
sInstance->unpause();
yield(); //Hopefully let the Lua thread resume
yields++;
if(timer.hasExpired())
{
LL_WARNS("Lua") << "Aborting critical section after "
<< timer.getElapsedTimeF64()*(F64)1000.f << "ms " << llendl;
sInstance->mAllowPause=true; // NOTE: Lua taking too much time. Force new critical requests
// to next frame.
break;
}
}
int sec=sInstance->mCriticalSections;
if(sec) //Main has resumed with Lua in a critical section. Not thread safe.
LL_WARNS("Lua") << sec << " critical sections active. Unsafe resume!" << llendl;
LL_INFOS("Lua") << "Finished critical section after "
<< timer.getElapsedTimeF64()*(F64)1000.f << "ms. Yields=" << yields << llendl;
}
}