本文整理汇总了C++中ThreadContext::IsScriptActive方法的典型用法代码示例。如果您正苦于以下问题:C++ ThreadContext::IsScriptActive方法的具体用法?C++ ThreadContext::IsScriptActive怎么用?C++ ThreadContext::IsScriptActive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ThreadContext
的用法示例。
在下文中一共展示了ThreadContext::IsScriptActive方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Uninitialize
// This is called at process detach.
// threadcontext created from runtime should not be destroyed in ThreadBoundThreadContext
// we should clean them up at process detach only as runtime can be used in other threads
// even after the current physical thread was destroyed.
// This is called after ThreadBoundThreadContext are cleaned up, so the remaining items
// in the globalthreadContext linklist should be for jsrt only.
void JsrtRuntime::Uninitialize()
{
ThreadContext* currentThreadContext = ThreadContext::GetThreadContextList();
ThreadContext* tmpThreadContext;
while (currentThreadContext)
{
Assert(!currentThreadContext->IsScriptActive());
JsrtRuntime* currentRuntime = static_cast<JsrtRuntime*>(currentThreadContext->GetJSRTRuntime());
tmpThreadContext = currentThreadContext;
currentThreadContext = currentThreadContext->Next();
currentRuntime->CloseContexts();
RentalThreadContextManager::DestroyThreadContext(tmpThreadContext);
HeapDelete(currentRuntime);
}
}
示例2: RaiseIfScriptActive
bool Exception::RaiseIfScriptActive(ScriptContext *scriptContext, unsigned kind, PVOID returnAddress)
{
ThreadContext *threadContext = ThreadContext::GetContextForCurrentThread();
if (threadContext != nullptr && threadContext->IsScriptActive())
{
switch (kind) {
case ExceptionKind_OutOfMemory:
AssertMsg(returnAddress == NULL, "should not have returnAddress passed in");
JavascriptError::ThrowOutOfMemoryError(scriptContext);
case ExceptionKind_StackOverflow:
JavascriptError::ThrowStackOverflowError(scriptContext, returnAddress);
default:
AssertMsg(false, "Invalid ExceptionKind");
}
}
return false;
}
示例3: Uninitialize
// This is called at process detach.
// threadcontext created from runtime should not be destroyed in ThreadBoundThreadContext
// we should clean them up at process detach only as runtime can be used in other threads
// even after the current physical thread was destroyed.
// This is called after ThreadBoundThreadContext are cleaned up, so the remaining items
// in the globalthreadContext linklist should be for jsrt only.
void JsrtRuntime::Uninitialize()
{
ThreadContext* currentThreadContext = ThreadContext::GetThreadContextList();
ThreadContext* tmpThreadContext;
while (currentThreadContext)
{
Assert(!currentThreadContext->IsScriptActive());
JsrtRuntime* currentRuntime = static_cast<JsrtRuntime*>(currentThreadContext->GetJSRTRuntime());
tmpThreadContext = currentThreadContext;
currentThreadContext = currentThreadContext->Next();
#ifdef CHAKRA_STATIC_LIBRARY
// xplat-todo: Cleanup staticlib shutdown. This only shuts down threads.
// Other closing contexts / finalizers having trouble with current
// runtime/context.
RentalThreadContextManager::DestroyThreadContext(tmpThreadContext);
#else
currentRuntime->CloseContexts();
RentalThreadContextManager::DestroyThreadContext(tmpThreadContext);
HeapDelete(currentRuntime);
#endif
}
}