public static void initRootFiber(ThreadContext context, RubyThread currentThread) { Ruby runtime = context.runtime; ThreadFiber rootFiber = new ThreadFiber(runtime, runtime.getFiber()); rootFiber.data = new FiberData(new FiberQueue(runtime), currentThread, rootFiber); rootFiber.thread = currentThread; context.setRootFiber(rootFiber); }
public static void initRootFiber(ThreadContext context, RubyThread currentThread) { Ruby runtime = context.runtime; ThreadFiber rootFiber = new ThreadFiber(runtime, runtime.getFiber()); rootFiber.data = new FiberData(new FiberQueue(runtime), currentThread, rootFiber); rootFiber.thread = currentThread; context.setRootFiber(rootFiber); }
@JRubyMethod(visibility = Visibility.PRIVATE) public IRubyObject initialize(ThreadContext context, Block block) { Ruby runtime = context.runtime; if (!block.isGiven()) throw runtime.newArgumentError("tried to create Proc object without block"); data = new FiberData(new FiberQueue(runtime), context.getFiberCurrentThread(), this); FiberData currentFiberData = context.getFiber().data; thread = createThread(runtime, data, currentFiberData.queue, block); return context.nil; }
@JRubyMethod(visibility = Visibility.PRIVATE) public IRubyObject initialize(ThreadContext context, Block block) { Ruby runtime = context.runtime; if (!block.isGiven()) throw runtime.newArgumentError("tried to create Proc object without block"); data = new FiberData(new FiberQueue(runtime), context.getFiberCurrentThread(), this); FiberData currentFiberData = context.getFiber().data; thread = createThread(runtime, data, currentFiberData.queue, block); return context.nil; }