本文整理汇总了C++中Isolate::Exit方法的典型用法代码示例。如果您正苦于以下问题:C++ Isolate::Exit方法的具体用法?C++ Isolate::Exit怎么用?C++ Isolate::Exit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Isolate
的用法示例。
在下文中一共展示了Isolate::Exit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
AutoIsolateCleanup::~AutoIsolateCleanup() {
while (Isolate::GetCurrent()) {
// Isolates can be entered multiple times
Isolate* i {Isolate::GetCurrent()};
//internal::Isolate* ii {internal::Isolate::FromAPIIsolate(i)};
//V8MONKEY_ASSERT(!ii->IsLockedForThisThread(), "An isolate was still locked");
while (Isolate::GetCurrent() == i) {
i->Exit();
}
i->Dispose();
}
}
示例2: ul
/*
* Prototype:
* Thread.sleep(delay)
*
* Docs:
* TBW
*
* Example:
* TBW
*/
static void
gum_script_thread_on_sleep (const FunctionCallbackInfo<Value> & info)
{
Isolate * isolate = info.GetIsolate ();
Local<Value> delay_val = info[0];
if (!delay_val->IsNumber ())
{
isolate->ThrowException (Exception::TypeError (String::NewFromUtf8 (isolate,
"Thread.sleep: argument must be a number specifying delay")));
return;
}
double delay = delay_val->ToNumber ()->Value ();
isolate->Exit ();
{
Unlocker ul (isolate);
g_usleep (delay * G_USEC_PER_SEC);
}
isolate->Enter ();
}