public ThreadContext getCurrentContext() { return threadService.getCurrentContext(); }
public ThreadContext getCurrentContext() { return threadService.getCurrentContext(); }
public ThreadContext getCurrentContext() { return threadService.getCurrentContext(); }
public ThreadContext getCurrentContext() { return threadService.getCurrentContext(); }
public void unregisterThread(RubyThread thread) { rubyThreadMap.remove(Thread.currentThread()); // synchronized getCurrentContext().setThread(null); localContext.set(null); }
public void unregisterThread(RubyThread thread) { rubyThreadMap.remove(Thread.currentThread()); // synchronized getCurrentContext().setThread(null); localContext.set(null); }
public synchronized void unregisterThread(RubyThread thread) { rubyThreadMap.remove(Thread.currentThread()); getCurrentContext().setThread(null); localContext.set(null); }
public synchronized void unregisterThread(RubyThread thread) { rubyThreadMap.remove(Thread.currentThread()); getCurrentContext().setThread(null); localContext.set(null); }
private RubyArray callRackApplication(RubyHash rubyHash) { return (RubyArray) application.callMethod(threadService.getCurrentContext(), "call", rubyHash); }
private RubyArray callRackApplication(RubyHash rubyHash) { return (RubyArray) application.callMethod(threadService.getCurrentContext(), "call", rubyHash); }
public void deliverEvent(Event event) { // first, check if the sender has unreceived mail event.sender.checkMail(getCurrentContext()); // then deliver mail to the target event.target.receiveMail(event); }
public void deliverEvent(Event event) { // first, check if the sender has unreceived mail event.sender.checkMail(getCurrentContext()); // then deliver mail to the target event.target.receiveMail(event); }
/** * Creates a byte array Iterator backed by the given Ruby Enumerable. * * @param body the backing Enumerable. */ public JRubyRackBodyIterator(IRubyObject body) { this.body = body; this.threadContext = body.getRuntime().getThreadService().getCurrentContext(); this.enumerator = (RubyEnumerator) body.callMethod(threadContext, "to_enum"); }
/** * Creates a byte array Iterator backed by the given Ruby Enumerable. * * @param body the backing Enumerable. */ public JRubyRackBodyIterator(IRubyObject body) { this.body = body; this.threadContext = body.getRuntime().getThreadService().getCurrentContext(); this.enumerator = (RubyEnumerator) body.callMethod(threadContext, "to_enum"); }
public void setRubyProperty(String propertyName, IRubyObject arg) { ThreadContext threadContext = runtime.getThreadService().getCurrentContext(); if (propertyName.startsWith("@")) { rubyNode.getInstanceVariables().setInstanceVariable(propertyName, arg); } else { if (arg == null) { rubyNode.callMethod(threadContext, propertyName + "=", runtime.getNil()); } else { rubyNode.callMethod(threadContext, propertyName + "=", arg); } } }
public void setRubyProperty(String propertyName, IRubyObject arg) { ThreadContext threadContext = runtime.getThreadService().getCurrentContext(); if (propertyName.startsWith("@")) { rubyNode.getInstanceVariables().setInstanceVariable(propertyName, arg); } else { if (arg == null) { rubyNode.callMethod(threadContext, propertyName + "=", runtime.getNil()); } else { rubyNode.callMethod(threadContext, propertyName + "=", arg); } } }
@JRubyMethod(meta = true) public static IRubyObject exit(IRubyObject receiver, Block block) { RubyThread rubyThread = receiver.getRuntime().getThreadService().getCurrentContext().getThread(); synchronized (rubyThread) { rubyThread.status.set(Status.ABORTING); // FIXME: This was not checking for non-null before, but maybe it should rubyThread.mail.set(null); receiver.getRuntime().getThreadService().setCritical(false); throw new ThreadKill(); } }
@JRubyMethod(meta = true) public static IRubyObject exit(IRubyObject receiver, Block block) { RubyThread rubyThread = receiver.getRuntime().getThreadService().getCurrentContext().getThread(); synchronized (rubyThread) { rubyThread.status.set(Status.ABORTING); // FIXME: This was not checking for non-null before, but maybe it should rubyThread.mail.set(null); receiver.getRuntime().getThreadService().setCritical(false); throw new ThreadKill(); } }
@JRubyMethod(meta = true) public static IRubyObject exit(IRubyObject receiver, Block block) { RubyThread rubyThread = receiver.getRuntime().getThreadService().getCurrentContext().getThread(); return rubyThread.kill(); }
@JRubyMethod(meta = true) public static IRubyObject exit(IRubyObject receiver, Block block) { RubyThread rubyThread = receiver.getRuntime().getThreadService().getCurrentContext().getThread(); return rubyThread.kill(); }