本文整理汇总了C++中LLTextureCacheWorker::scheduleDelete方法的典型用法代码示例。如果您正苦于以下问题:C++ LLTextureCacheWorker::scheduleDelete方法的具体用法?C++ LLTextureCacheWorker::scheduleDelete怎么用?C++ LLTextureCacheWorker::scheduleDelete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLTextureCacheWorker
的用法示例。
在下文中一共展示了LLTextureCacheWorker::scheduleDelete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readComplete
// Return true if the handle is not valid, which is the case
// when the worker was already deleted or is scheduled for deletion.
//
// If the handle exists and a call to worker->complete() returns
// true or abort is true, then the handle is removed and the worker
// scheduled for deletion.
bool LLTextureCache::readComplete(handle_t handle, bool abort)
{
lockWorkers(); // Needed for access to mReaders.
handle_map_t::iterator iter = mReaders.find(handle);
bool handle_is_valid = iter != mReaders.end();
llassert_always(handle_is_valid || abort);
LLTextureCacheWorker* worker = NULL;
bool delete_worker = false;
if (handle_is_valid)
{
worker = iter->second;
delete_worker = worker->complete() || abort;
if (delete_worker)
{
mReaders.erase(handle);
handle_is_valid = false;
}
}
unlockWorkers();
if (delete_worker) worker->scheduleDelete();
// Return false if the handle is (still) valid.
return !handle_is_valid;
}
示例2: writeComplete
bool LLTextureCache::writeComplete(handle_t handle, bool abort)
{
lockWorkers();
handle_map_t::iterator iter = mWriters.find(handle);
llassert_always(iter != mWriters.end());
LLTextureCacheWorker* worker = iter->second;
if (worker->complete() || abort)
{
mWriters.erase(handle);
unlockWorkers();
worker->scheduleDelete();
return true;
}
else
{
unlockWorkers();
return false;
}
}