Examples of newThreadError()


Examples of org.jruby.Ruby.newThreadError()

        @JRubyMethod(name = "unlock", compat = RUBY1_8)
        public synchronized IRubyObject unlock(ThreadContext context) {
            Ruby runtime = context.getRuntime();

            if (!isLocked()) throw runtime.newThreadError("Mutex is not locked");

            if (owner != context.getThread()) {
                throw runtime.newThreadError("Mutex is not owned by calling thread");
            }
View Full Code Here

Examples of org.jruby.Ruby.newThreadError()

            Ruby runtime = context.getRuntime();

            if (!isLocked()) throw runtime.newThreadError("Mutex is not locked");

            if (owner != context.getThread()) {
                throw runtime.newThreadError("Mutex is not owned by calling thread");
            }

            // FIXME: 1.8 throws nil when the unlock is not waking.  I don't
            // think we can know this?
            owner = null;
View Full Code Here

Examples of org.jruby.Ruby.newThreadError()

        @JRubyMethod(name = "unlock", compat = RUBY1_9)
        public synchronized IRubyObject unlock19(ThreadContext context) {
            Ruby runtime = context.getRuntime();

            if (!isLocked()) {
                throw runtime.newThreadError("Attempt to unlock a mutex which is not locked");
            }

            if (owner != context.getThread()) {
                throw runtime.newThreadError("Attempt to unlock a mutex which is locked by another thread");
            }
View Full Code Here

Examples of org.jruby.Ruby.newThreadError()

            if (!isLocked()) {
                throw runtime.newThreadError("Attempt to unlock a mutex which is not locked");
            }

            if (owner != context.getThread()) {
                throw runtime.newThreadError("Attempt to unlock a mutex which is locked by another thread");
            }

            owner = null;
            notify();
            return this;
View Full Code Here

Examples of org.jruby.Ruby.newThreadError()

    @JRubyMethod
    public synchronized IRubyObject unlock(ThreadContext context) {
        Ruby runtime = context.runtime;
        if (!lock.isLocked()) {
            throw runtime.newThreadError("Mutex is not locked");
        }
        if (!lock.isHeldByCurrentThread()) {
            throw runtime.newThreadError("Mutex is not owned by calling thread");
        }
       
View Full Code Here

Examples of org.jruby.Ruby.newThreadError()

        Ruby runtime = context.runtime;
        if (!lock.isLocked()) {
            throw runtime.newThreadError("Mutex is not locked");
        }
        if (!lock.isHeldByCurrentThread()) {
            throw runtime.newThreadError("Mutex is not owned by calling thread");
        }
       
        boolean hasQueued = lock.hasQueuedThreads();
        context.getThread().unlock(lock);
        return hasQueued ? context.nil : this;
View Full Code Here

Examples of org.jruby.Ruby.newThreadError()

   
    @JRubyMethod(rest = true, visibility = Visibility.PRIVATE)
    public IRubyObject initialize(ThreadContext context, IRubyObject[] _events, final Block block) {
        final Ruby runtime = context.runtime;
       
        if (!block.isGiven()) throw runtime.newThreadError("must be called with a block");
       
        ArrayList<RubyEvent> events = new ArrayList<RubyEvent>(_events.length);
        for (int i = 0; i < _events.length; i++) {
            IRubyObject _event = _events[i];
            if (_event instanceof RubySymbol || _event instanceof RubyString) {
View Full Code Here

Examples of org.jruby.Ruby.newThreadError()

    @JRubyMethod
    public synchronized IRubyObject unlock(ThreadContext context) {
        Ruby runtime = context.runtime;
        if (!lock.isLocked()) {
            throw runtime.newThreadError("Mutex is not locked");
        }
        if (!lock.isHeldByCurrentThread()) {
            throw runtime.newThreadError("Mutex is not owned by calling thread");
        }
       
View Full Code Here

Examples of org.jruby.Ruby.newThreadError()

        Ruby runtime = context.runtime;
        if (!lock.isLocked()) {
            throw runtime.newThreadError("Mutex is not locked");
        }
        if (!lock.isHeldByCurrentThread()) {
            throw runtime.newThreadError("Mutex is not owned by calling thread");
        }
       
        boolean hasQueued = lock.hasQueuedThreads();
        context.getThread().unlock(lock);
        return hasQueued ? context.nil : this;
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.