本文整理汇总了C++中statet::switch_to_thread方法的典型用法代码示例。如果您正苦于以下问题:C++ statet::switch_to_thread方法的具体用法?C++ statet::switch_to_thread怎么用?C++ statet::switch_to_thread使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类statet
的用法示例。
在下文中一共展示了statet::switch_to_thread方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: operator
void goto_symext::operator()(
statet &state,
const goto_functionst &goto_functions,
const goto_programt &goto_program)
{
assert(!goto_program.instructions.empty());
state.source=symex_targett::sourcet(goto_program);
assert(!state.threads.empty());
assert(!state.call_stack().empty());
state.top().end_of_function=--goto_program.instructions.end();
state.top().calling_location.pc=state.top().end_of_function;
state.symex_target=⌖
state.dirty=new dirtyt(goto_functions);
assert(state.top().end_of_function->is_end_function());
while(!state.call_stack().empty())
{
symex_step(goto_functions, state);
// is there another thread to execute?
if(state.call_stack().empty() &&
state.source.thread_nr+1<state.threads.size())
{
unsigned t=state.source.thread_nr+1;
// std::cout << "********* Now executing thread " << t << std::endl;
state.switch_to_thread(t);
}
}
delete state.dirty;
state.dirty=0;
}