本文整理汇总了C++中ThreadInfo::UpdateCurrentTime方法的典型用法代码示例。如果您正苦于以下问题:C++ ThreadInfo::UpdateCurrentTime方法的具体用法?C++ ThreadInfo::UpdateCurrentTime怎么用?C++ ThreadInfo::UpdateCurrentTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ThreadInfo
的用法示例。
在下文中一共展示了ThreadInfo::UpdateCurrentTime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetThreadInfo
void
__end_ctrace__ (CTraceStruct *c, const char *name)
{
if (file_to_write == 0)
return;
ThreadInfo *tinfo = GetThreadInfo ();
tinfo->stack_end_--;
if (tinfo->stack_end_ < ThreadInfo::max_stack)
{
if (c->start_time_ != invalid_time)
{
if (tinfo->stack_end_ == 0)
{
tinfo->UpdateCurrentTime ();
c->min_end_time_ = tinfo->current_time_ + ticks;
}
// we should record this
RecordThis (c, tinfo);
if (tinfo->stack_end_ != 0)
{
// propagate the back's mini end time
tinfo->stack_[tinfo->stack_end_ - 1]->min_end_time_
= c->min_end_time_ + ticks;
tinfo->stack_[tinfo->stack_end_ - 1]->min_end_time_thread_
= c->min_end_time_thread_ + ticks;
tinfo->current_time_ += ticks;
tinfo->current_time_thread_ += ticks;
}
}
}
}
示例2: new
void
__start_ctrace__ (void *c, const char *name)
{
if (file_to_write == 0)
return;
CTraceStruct *cs = new (c) CTraceStruct (name);
ThreadInfo *tinfo = GetThreadInfo ();
if (tinfo->stack_end_ == 0)
{
// always update the time in the first entry.
// Or if it sleep too long, will make this entry looks
// very time consuming.
tinfo->UpdateCurrentTime ();
}
if (tinfo->stack_end_ < ThreadInfo::max_stack)
{
tinfo->stack_[tinfo->stack_end_] = cs;
}
tinfo->stack_end_++;
}