本文整理汇总了C++中LLFrameTimer::resetWithExpiry方法的典型用法代码示例。如果您正苦于以下问题:C++ LLFrameTimer::resetWithExpiry方法的具体用法?C++ LLFrameTimer::resetWithExpiry怎么用?C++ LLFrameTimer::resetWithExpiry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLFrameTimer
的用法示例。
在下文中一共展示了LLFrameTimer::resetWithExpiry方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: requestLock
bool LLPidLockFile::requestLock(LLNameTable<void *> *name_table, bool autosave,
bool force_immediate, F32 timeout)
{
bool readyToSave = FALSE;
if (mSaving) return FALSE; //Bail out if we're currently saving. Will not queue another save.
if (!mWaiting){
mNameTable=name_table;
mAutosave = autosave;
}
LLSD out_pids;
out_pids.append( (LLSD::Integer)mPID );
llifstream ifile(mLockName);
if (ifile.is_open())
{ //If file exists, we need to decide whether or not to continue.
if ( force_immediate
|| mTimer.hasExpired() ) //Only deserialize if we REALLY need to.
{
LLSD in_pids;
LLSDSerialize::fromXML(in_pids, ifile);
//Clean up any dead PIDS that might be in there.
for (LLSD::array_iterator i=in_pids.beginArray();
i !=in_pids.endArray();
++i)
{
U32 stored_pid=(*i).asInteger();
if (isProcessAlive(stored_pid))
{
out_pids.append( (*i) );
}
}
readyToSave=TRUE;
}
ifile.close();
}
else
{
readyToSave=TRUE;
}
if (!mWaiting) //Not presently waiting to save. Queue up.
{
mTimer.resetWithExpiry(timeout);
mWaiting=TRUE;
}
if (readyToSave)
{ //Potential race condition won't kill us. Ignore it.
writeLockFile(out_pids);
mSaving=TRUE;
}
return readyToSave;
}