public boolean isAlive(){ return threadImpl.isAlive() && status.get() != Status.DEAD; }
public boolean isAlive(){ return threadImpl.isAlive() && status.get() != Status.ABORTING; }
public boolean isAlive(){ return threadImpl.isAlive() && status.get() != Status.DEAD; }
public boolean isAlive(){ return threadImpl.isAlive() && status.get() != Status.ABORTING; }
@JRubyMethod(name = "wakeup") public synchronized RubyThread wakeup() { if(!threadImpl.isAlive() && status.get() == Status.DEAD) { throw getRuntime().newThreadError("killed thread"); } status.set(Status.RUN); notifyAll(); return this; }
@JRubyMethod(name = "wakeup") public synchronized RubyThread wakeup() { if(!threadImpl.isAlive() && status.get() == Status.DEAD) { throw getRuntime().newThreadError("killed thread"); } status.set(Status.RUN); notifyAll(); return this; }
private synchronized IRubyObject status(Ruby runtime) { if (threadImpl.isAlive()) { return RubyString.newStringShared(runtime, status.get().bytes); } else if (exitingException != null) { return runtime.getNil(); } else { return runtime.getFalse(); } }
@JRubyMethod public synchronized RubyThread wakeup() { if(!threadImpl.isAlive() && status.get() == Status.DEAD) { throw getRuntime().newThreadError("killed thread"); } status.set(Status.RUN); interrupt(); return this; }
private synchronized IRubyObject status(Ruby runtime) { if (threadImpl.isAlive()) { return RubyString.newStringShared(runtime, status.get().bytes); } else if (exitingException != null) { return runtime.getNil(); } else { return runtime.getFalse(); } }
@JRubyMethod public synchronized RubyThread wakeup() { if(!threadImpl.isAlive() && status.get() == Status.DEAD) { throw getRuntime().newThreadError("killed thread"); } status.set(Status.RUN); interrupt(); return this; }
private synchronized IRubyObject status(Ruby runtime) { Status status; if (threadImpl.isAlive()) { status = this.status.get(); if (status == Status.DEAD) { return runtime.getFalse(); } return runtime.getThreadStatus(status); } else if (exitingException != null) { return runtime.getNil(); } else { return runtime.getFalse(); } }
private synchronized IRubyObject status(Ruby runtime) { Status status; if (threadImpl.isAlive()) { status = this.status.get(); if (status == Status.DEAD) { return runtime.getFalse(); } return runtime.getThreadStatus(status); } else if (exitingException != null) { return runtime.getNil(); } else { return runtime.getFalse(); } }
@JRubyMethod(name = "priority=", required = 1) public IRubyObject priority_set(IRubyObject priority) { int iPriority = RubyNumeric.fix2int(priority); if (iPriority < RUBY_MIN_THREAD_PRIORITY) { iPriority = RUBY_MIN_THREAD_PRIORITY; } else if (iPriority > RUBY_MAX_THREAD_PRIORITY) { iPriority = RUBY_MAX_THREAD_PRIORITY; } if (threadImpl.isAlive()) { int jPriority = rubyPriorityToJavaPriority(iPriority); if (jPriority < Thread.MIN_PRIORITY) { jPriority = Thread.MIN_PRIORITY; } else if (jPriority > Thread.MAX_PRIORITY) { jPriority = Thread.MAX_PRIORITY; } threadImpl.setPriority(jPriority); } return RubyFixnum.newFixnum(getRuntime(), iPriority); }
@JRubyMethod(name = "priority=", required = 1) public IRubyObject priority_set(IRubyObject priority) { int iPriority = RubyNumeric.fix2int(priority); if (iPriority < RUBY_MIN_THREAD_PRIORITY) { iPriority = RUBY_MIN_THREAD_PRIORITY; } else if (iPriority > RUBY_MAX_THREAD_PRIORITY) { iPriority = RUBY_MAX_THREAD_PRIORITY; } if (threadImpl.isAlive()) { int jPriority = rubyPriorityToJavaPriority(iPriority); if (jPriority < Thread.MIN_PRIORITY) { jPriority = Thread.MIN_PRIORITY; } else if (jPriority > Thread.MAX_PRIORITY) { jPriority = Thread.MAX_PRIORITY; } threadImpl.setPriority(jPriority); } return RubyFixnum.newFixnum(getRuntime(), iPriority); }
@JRubyMethod(name = "priority=", required = 1) public IRubyObject priority_set(IRubyObject priority) { int iPriority = RubyNumeric.fix2int(priority); if (iPriority < RUBY_MIN_THREAD_PRIORITY) { iPriority = RUBY_MIN_THREAD_PRIORITY; } else if (iPriority > RUBY_MAX_THREAD_PRIORITY) { iPriority = RUBY_MAX_THREAD_PRIORITY; } if (threadImpl.isAlive()) { int jPriority = rubyPriorityToJavaPriority(iPriority); if (jPriority < Thread.MIN_PRIORITY) { jPriority = Thread.MIN_PRIORITY; } else if (jPriority > Thread.MAX_PRIORITY) { jPriority = Thread.MAX_PRIORITY; } threadImpl.setPriority(jPriority); } return RubyFixnum.newFixnum(getRuntime(), iPriority); }
@JRubyMethod(name = "priority=", required = 1) public IRubyObject priority_set(IRubyObject priority) { int iPriority = RubyNumeric.fix2int(priority); if (iPriority < RUBY_MIN_THREAD_PRIORITY) { iPriority = RUBY_MIN_THREAD_PRIORITY; } else if (iPriority > RUBY_MAX_THREAD_PRIORITY) { iPriority = RUBY_MAX_THREAD_PRIORITY; } if (threadImpl.isAlive()) { int jPriority = rubyPriorityToJavaPriority(iPriority); if (jPriority < Thread.MIN_PRIORITY) { jPriority = Thread.MIN_PRIORITY; } else if (jPriority > Thread.MAX_PRIORITY) { jPriority = Thread.MAX_PRIORITY; } threadImpl.setPriority(jPriority); } return RubyFixnum.newFixnum(getRuntime(), iPriority); }