本文整理汇总了C++中thread::ThreadData::get方法的典型用法代码示例。如果您正苦于以下问题:C++ ThreadData::get方法的具体用法?C++ ThreadData::get怎么用?C++ ThreadData::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thread::ThreadData
的用法示例。
在下文中一共展示了ThreadData::get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: current
VM* VM::current() {
return _current_vm.get();
}
示例2: executor_implementation
Object* NativeMethod::executor_implementation(STATE,
CallFrame* call_frame, Dispatch& msg, Arguments& args) {
NativeMethod* nm = as<NativeMethod>(msg.method);
int arity = nm->arity()->to_int();
if(arity >= 0 && (size_t)arity != args.total()) {
Exception* exc = Exception::make_argument_error(
state, arity, args.total(), msg.name);
exc->locations(state, Location::from_call_stack(state, call_frame));
state->thread_state()->raise_exception(exc);
return NULL;
}
NativeMethodEnvironment* env = native_method_environment.get();
// Optionally get the handles back to the proper state.
if(state->shared.config.capi_global_flush) {
capi::Handles* handles = state->shared.cached_handles();
if(handles->size() > 0) {
for(capi::Handles::Iterator i(*handles); i.more(); i.advance()) {
i->update(env);
}
}
}
// Register the CallFrame, because we might GC below this.
state->set_call_frame(call_frame);
NativeMethodFrame nmf(env->current_native_frame());
CallFrame* saved_frame = env->current_call_frame();
env->set_current_call_frame(call_frame);
env->set_current_native_frame(&nmf);
// Be sure to do this after installing nmf as the current
// native frame.
nmf.setup(
env->get_handle(args.recv()),
env->get_handle(args.block()),
env->get_handle(msg.method),
env->get_handle(msg.module));
Object* ret;
ExceptionPoint ep(env);
PLACE_EXCEPTION_POINT(ep);
if(unlikely(ep.jumped_to())) {
ret = NULL;
} else {
#ifdef RBX_PROFILER
if(unlikely(state->tooling())) {
tooling::MethodEntry method(state, msg, args);
ret = ArgumentHandler::invoke(state, nm, env, args);
} else {
ret = ArgumentHandler::invoke(state, nm, env, args);
}
#else
ret = ArgumentHandler::invoke(state, nm, env, args);
#endif
}
env->set_current_call_frame(saved_frame);
env->set_current_native_frame(nmf.previous());
ep.pop(env);
// Handle any signals that occurred while the native method
// was running.
if(!state->check_async(call_frame)) return NULL;
return ret;
}
示例3: get
NativeMethodEnvironment* NativeMethodEnvironment::get() {
return native_method_environment.get();
}
示例4: cleanup_thread
void NativeMethod::cleanup_thread(STATE) {
delete native_method_environment.get();
native_method_environment.set(NULL);
}