v8::Handle<v8::Value> setTimeoutImpl(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Local<v8::Value> callback(info[0]);
if (callback->IsFunction()) {
v8::Handle<v8::Function> func = v8::Handle<v8::Function>::Cast(callback);
v8::Handle<v8::Value> args[0];
v8::Handle<v8::Value> result;
result = func->Call(info.GetIsolate()->GetCurrentContext()->Global(), 0, args);
info.GetReturnValue().Set(result);
}
}
pthread_t tid;
pthread_attr_t tattr;
pthread_attr_init(&tattr);
pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED);
pthread_create(&tid, &tattr, thread_setTimeout, &ji);
pthread_attr_destroy(&tattr);
static void* thread_setTimeout( void * arg ) {
v8::Locker locker(v8::Isolate::GetCurrent());
v8::HandleScope handle_scope(v8::Isolate::GetCurrent());
usleep( 1000000 );
v8::Unlocker unlocker(v8::Isolate::GetCurrent());
}
t
0x00007ffff56c6b7f in v8::Locker::Initialize(v8::Isolate*) ()