本文整理汇总了C++中Activity::reset方法的典型用法代码示例。如果您正苦于以下问题:C++ Activity::reset方法的具体用法?C++ Activity::reset怎么用?C++ Activity::reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Activity
的用法示例。
在下文中一共展示了Activity::reset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Activity
/**
* Obtain a new activity for running on a separate thread.
*
* @return The created (or pooled) activity object.
*/
Activity *ActivityManager::createNewActivity()
{
ResourceSection lock; // lock the control information
// try to get an activity from the cache
Activity *activity = (Activity *)availableActivities->pull();
if (activity == OREF_NULL)
{
// we release the resource lock around creating
// a new activation
lock.release();
activity = new Activity(true);
lock.reacquire();
// add this to our table of all activities
allActivities->append(activity);
}
else
{
// We are able to reuse an activity, so just re-initialize it.
activity->reset();
}
return activity;
}