Examples of ThreadService


Examples of org.jruby.internal.runtime.ThreadService

     */
    private Ruby(RubyInstanceConfig config) {
        this.config             = config;
        this.is1_9              = config.getCompatVersion() == CompatVersion.RUBY1_9;
        this.doNotReverseLookupEnabled = is1_9;
        this.threadService      = new ThreadService(this);
        if(config.isSamplingEnabled()) {
            org.jruby.util.SimpleSampler.registerThreadContext(threadService.getCurrentContext());
        }

        this.in                 = config.getInput();
View Full Code Here

Examples of org.jruby.internal.runtime.ThreadService

    }

    @JRubyMethod(name = "pass", meta = true)
    public static IRubyObject pass(IRubyObject recv) {
        Ruby runtime = recv.getRuntime();
        ThreadService ts = runtime.getThreadService();
        boolean critical = ts.getCritical();
       
        ts.setCritical(false);
       
        Thread.yield();
       
        ts.setCritical(critical);
       
        return recv.getRuntime().getNil();
    }
View Full Code Here

Examples of org.jruby.internal.runtime.ThreadService

    }

    @JRubyMethod(name = "pass", meta = true)
    public static IRubyObject pass(IRubyObject recv) {
        Ruby runtime = recv.getRuntime();
        ThreadService ts = runtime.getThreadService();
        boolean critical = ts.getCritical();
       
        ts.setCritical(false);
       
        Thread.yield();
       
        ts.setCritical(critical);
       
        return recv.getRuntime().getNil();
    }
View Full Code Here

Examples of org.jruby.internal.runtime.ThreadService

     * @param config The configuration to use for the new instance
     * @see org.jruby.RubyInstanceConfig
     */
    private Ruby(RubyInstanceConfig config) {
        this.config             = config;
        this.threadService      = new ThreadService(this);
        if(config.isSamplingEnabled()) {
            org.jruby.util.SimpleSampler.registerThreadContext(threadService.getCurrentContext());
        }
       
        if (config.getCompileMode() == CompileMode.OFFIR ||
View Full Code Here

Examples of org.jruby.internal.runtime.ThreadService

* Methods added to the Thread class.
*/
public class ThreadMethods {
    @JRubyMethod(name = "exclusive", meta = true, compat = CompatVersion.RUBY1_8)
    public static IRubyObject exclusive(ThreadContext context, IRubyObject receiver, Block block) {
        ThreadService service = context.runtime.getThreadService();
        boolean old = service.getCritical();
        try {
            service.setCritical(true);
            return block.yield(receiver.getRuntime().getCurrentContext(), (IRubyObject) null);
        } finally {
            service.setCritical(old);
        }
    }
View Full Code Here

Examples of org.jruby.internal.runtime.ThreadService

     * @param config The configuration to use for the new instance
     * @see org.jruby.RubyInstanceConfig
     */
    private Ruby(RubyInstanceConfig config) {
        this.config             = config;
        this.threadService      = new ThreadService(this);

        if( config.isProfiling() ) {
            this.profiledMethods        = new ProfiledMethods(this);
            this.profilingServiceLookup = new ProfilingServiceLookup(this);
        } else {
View Full Code Here

Examples of org.jruby.internal.runtime.ThreadService

    }

    @JRubyMethod(meta = true)
    public static IRubyObject pass(IRubyObject recv) {
        Ruby runtime = recv.getRuntime();
        ThreadService ts = runtime.getThreadService();
        boolean critical = ts.getCritical();
       
        ts.setCritical(false);
       
        Thread.yield();
       
        ts.setCritical(critical);
       
        return recv.getRuntime().getNil();
    }
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.