Examples of newFiberError()


Examples of org.jruby.Ruby.newFiberError()

                context.setThread(context.getThread());
                Coroutine.yieldTo(coro);
                break;
            case SUSPENDED_TRANSFER:
                if (!transfer) {
                    throw runtime.newFiberError("double resume");
                }
                current.state = CoroutineFiberState.SUSPENDED_TRANSFER;
                state = CoroutineFiberState.RUNNING;
                runtime.getThreadService().setCurrentContext(context);
                context.setThread(context.getThread());
View Full Code Here

Examples of org.jruby.Ruby.newFiberError()

                runtime.getThreadService().setCurrentContext(context);
                context.setThread(context.getThread());
                Coroutine.yieldTo(coro);
                break;
            case FINISHED:
                throw runtime.newFiberError("dead fiber called");
            default:
                throw runtime.newFiberError("fiber in an invalid state: " + state);
        }

        try {
View Full Code Here

Examples of org.jruby.Ruby.newFiberError()

                Coroutine.yieldTo(coro);
                break;
            case FINISHED:
                throw runtime.newFiberError("dead fiber called");
            default:
                throw runtime.newFiberError("fiber in an invalid state: " + state);
        }

        try {
            if (coroException != null) {
                throw coroException;
View Full Code Here

Examples of org.jruby.Ruby.newFiberError()

   
    @JRubyMethod(rest = true)
    public IRubyObject resume(ThreadContext context, IRubyObject[] values) {
        Ruby runtime = context.runtime;
       
        if (data.prev != null || data.transferred) throw runtime.newFiberError("double resume");
       
        if (!alive()) throw runtime.newFiberError("dead fiber called");
       
        FiberData currentFiberData = context.getFiber().data;
       
View Full Code Here

Examples of org.jruby.Ruby.newFiberError()

    public IRubyObject resume(ThreadContext context, IRubyObject[] values) {
        Ruby runtime = context.runtime;
       
        if (data.prev != null || data.transferred) throw runtime.newFiberError("double resume");
       
        if (!alive()) throw runtime.newFiberError("dead fiber called");
       
        FiberData currentFiberData = context.getFiber().data;
       
        if (this.data == currentFiberData) {
            switch (values.length) {
View Full Code Here

Examples of org.jruby.Ruby.newFiberError()

            case 0: val = NEVER; break;
            case 1: val = values[0]; break;
            default: val = runtime.newArrayNoCopyLight(values);
        }
       
        if (data.parent != context.getFiberCurrentThread()) throw runtime.newFiberError("fiber called across threads");
       
        data.prev = context.getFiber();

        try {
            return exchangeWithFiber(context, currentFiberData, data, val);
View Full Code Here

Examples of org.jruby.Ruby.newFiberError()

    @JRubyMethod(rest = true)
    public IRubyObject __transfer__(ThreadContext context, IRubyObject[] values) {
        Ruby runtime = context.runtime;
       
        if (data.prev != null) throw runtime.newFiberError("double resume");
       
        if (!alive()) throw runtime.newFiberError("dead fiber called");
       
        FiberData currentFiberData = context.getFiber().data;
       
View Full Code Here

Examples of org.jruby.Ruby.newFiberError()

    public IRubyObject __transfer__(ThreadContext context, IRubyObject[] values) {
        Ruby runtime = context.runtime;
       
        if (data.prev != null) throw runtime.newFiberError("double resume");
       
        if (!alive()) throw runtime.newFiberError("dead fiber called");
       
        FiberData currentFiberData = context.getFiber().data;
       
        if (this.data == currentFiberData) {
            switch (values.length) {
View Full Code Here

Examples of org.jruby.Ruby.newFiberError()

            case 0: val = NEVER; break;
            case 1: val = values[0]; break;
            default: val = runtime.newArrayNoCopyLight(values);
        }
       
        if (data.parent != context.getFiberCurrentThread()) throw runtime.newFiberError("fiber called across threads");
       
        if (currentFiberData.prev != null) {
            // new fiber should answer to current prev and this fiber is marked as transferred
            data.prev = currentFiberData.prev;
            currentFiberData.prev = null;
View Full Code Here

Examples of org.jruby.Ruby.newFiberError()

    public static IRubyObject yield(ThreadContext context, IRubyObject recv, IRubyObject value) {
        Ruby runtime = context.runtime;
       
        FiberData currentFiberData = context.getFiber().data;
       
        if (currentFiberData.parent == null) throw runtime.newFiberError("can't yield from root fiber");

        if (currentFiberData.prev == null) throw runtime.newFiberError("BUG: yield occured with null previous fiber. Report this at http://bugs.jruby.org");

        if (currentFiberData.queue.isShutdown()) throw runtime.newFiberError("dead fiber yielded");
       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.