当前位置: 首页>>代码示例>>C++>>正文


C++ ThreadData::get方法代码示例

本文整理汇总了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();
 }
开发者ID:stormbrew,项目名称:rubinius,代码行数:3,代码来源:vm.cpp

示例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;
  }
开发者ID:AndreMeira,项目名称:rubinius,代码行数:75,代码来源:nativemethod.cpp

示例3: get

 NativeMethodEnvironment* NativeMethodEnvironment::get() {
   return native_method_environment.get();
 }
开发者ID:AndreMeira,项目名称:rubinius,代码行数:3,代码来源:nativemethod.cpp

示例4: cleanup_thread

 void NativeMethod::cleanup_thread(STATE) {
   delete native_method_environment.get();
   native_method_environment.set(NULL);
 }
开发者ID:AndreMeira,项目名称:rubinius,代码行数:4,代码来源:nativemethod.cpp


注:本文中的thread::ThreadData::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。