本文整理汇总了C++中ExecutionContext::fiberExit方法的典型用法代码示例。如果您正苦于以下问题:C++ ExecutionContext::fiberExit方法的具体用法?C++ ExecutionContext::fiberExit怎么用?C++ ExecutionContext::fiberExit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExecutionContext
的用法示例。
在下文中一共展示了ExecutionContext::fiberExit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getResults
// MAIN THREAD
Variant getResults(FiberAsyncFunc::Strategy default_strategy,
vector<pair<string, char> > &resolver) {
if (!m_async) return syncGetResults();
{
Lock lock(this);
while (!m_done) wait();
}
Variant unmarshaled_return;
try {
ExecutionContext *context = g_context.getNoCheck();
if (context && m_context) {
context->fiberExit(m_context, m_refMap);
m_context = NULL;
}
AutoloadHandler *handler = AutoloadHandler::s_instance.get();
if (handler && m_autoload_handler) {
handler->fiberExit(m_autoload_handler, m_refMap, default_strategy);
m_autoload_handler = NULL;
}
if (m_evalState) {
Eval::RequestEvalState::Get()->fiberExit(m_evalState, m_refMap,
default_strategy);
}
if (m_global_variables) {
fiber_unmarshal_global_state(get_global_variables(),
m_global_variables,
m_refMap, default_strategy, resolver);
}
// these are needed in case they have references or objects
if (!m_refMap.empty()) {
m_function.fiberUnmarshal(m_refMap);
m_params.fiberUnmarshal(m_refMap);
}
Object unmarshaled_exception = m_exception.fiberUnmarshal(m_refMap);
unmarshaled_return = m_return.fiberUnmarshal(m_refMap);
if (m_exit) {
throw ExitException(0);
}
if (!m_fatal.isNull()) {
throw FatalErrorException(m_fatal.data());
}
if (!m_exception.isNull()) {
throw unmarshaled_exception;
}
} catch (...) {
cleanup();
Lock lock(this);
m_delete = true;
notify();
throw;
}
cleanup();
Lock lock(this);
m_delete = true;
notify();
return unmarshaled_return;
}