Package org.jruby.internal.runtime

Examples of org.jruby.internal.runtime.FutureThread


        Ruby runtime = getRuntime();
        if (!block.isGiven()) throw runtime.newThreadError("must be called with a block");

        RubyRunnable runnable = new RubyRunnable(this, args, block);
        if (RubyInstanceConfig.POOLING_ENABLED) {
            threadImpl = new FutureThread(this, runnable);
        } else {
            Thread thread = new Thread(runnable);
            thread.setDaemon(true);
            threadImpl = new NativeThread(this, thread);
        }
View Full Code Here


        if (!block.isGiven()) throw runtime.newThreadError("must be called with a block");

        try {
            RubyRunnable runnable = new RubyRunnable(this, args, context.getFrames(0), block);
            if (RubyInstanceConfig.POOLING_ENABLED) {
                FutureThread futureThread = new FutureThread(this, runnable);
                threadImpl = futureThread;

                addToCorrectThreadGroup(context);

                threadImpl.start();

                // JRUBY-2380, associate future early so it shows up in Thread.list right away, in case it doesn't run immediately
                runtime.getThreadService().associateThread(futureThread.getFuture(), this);
            } else {
                Thread thread = new Thread(runnable);
                thread.setDaemon(true);
                thread.setName("Ruby" + thread.getName() + ": " + context.getFile() + ":" + (context.getLine() + 1));
                threadImpl = new NativeThread(this, thread);
View Full Code Here

        if (!block.isGiven()) throw runtime.newThreadError("must be called with a block");

        try {
            RubyRunnable runnable = new RubyRunnable(this, args, context.getFrames(0), block);
            if (RubyInstanceConfig.POOLING_ENABLED) {
                FutureThread futureThread = new FutureThread(this, runnable);
                threadImpl = futureThread;

                addToCorrectThreadGroup(context);

                threadImpl.start();

                // JRUBY-2380, associate future early so it shows up in Thread.list right away, in case it doesn't run immediately
                runtime.getThreadService().associateThread(futureThread.getFuture(), this);
            } else {
                Thread thread = new Thread(runnable);
                thread.setDaemon(true);
                thread.setName("Ruby" + thread.getName() + ": " + context.getFile() + ":" + (context.getLine() + 1));
                threadImpl = new NativeThread(this, thread);
View Full Code Here

TOP

Related Classes of org.jruby.internal.runtime.FutureThread

Copyright © 2018 www.massapicom. 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.