本文整理了Java中org.jruby.Ruby.newThreadError
方法的一些代码示例,展示了Ruby.newThreadError
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ruby.newThreadError
方法的具体详情如下:
包路径:org.jruby.Ruby
类名称:Ruby
方法名:newThreadError
暂无
代码示例来源:origin: org.jruby/jruby-complete
private static void checkContext(ThreadContext firstContext, ThreadContext secondContext, String name) {
if (firstContext != secondContext) {
throw secondContext.runtime.newThreadError("Enumerable#" + name + " cannot be parallelized");
}
}
代码示例来源:origin: org.jruby/jruby-core
private static void checkContext(ThreadContext firstContext, ThreadContext secondContext, String name) {
if (firstContext != secondContext) {
throw secondContext.runtime.newThreadError("Enumerable#" + name + " cannot be parallelized");
}
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
private static void checkContext(ThreadContext firstContext, ThreadContext secondContext, String name) {
if (firstContext != secondContext) {
throw secondContext.runtime.newThreadError("Enumerable#" + name + " cannot be parallelized");
}
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
private void threadCheck(ThreadContext yieldingContext) {
if (originalContext != null && yieldingContext != originalContext) {
throw yieldingContext.runtime.newThreadError("" + methodName + " cannot be parallelized");
}
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
private static void checkContext(ThreadContext firstContext, ThreadContext secondContext, String name) {
if (firstContext != secondContext) {
throw secondContext.runtime.newThreadError("Enumerable#" + name + " cannot be parallelized");
}
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
private void threadCheck(ThreadContext yieldingContext) {
if (originalContext != null && yieldingContext != originalContext) {
throw yieldingContext.runtime.newThreadError("" + methodName + " cannot be parallelized");
}
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
private void checkRelocking(ThreadContext context) {
if (lock.isHeldByCurrentThread()) {
throw context.runtime.newThreadError("Mutex relocking by same thread");
}
}
代码示例来源:origin: org.jruby/jruby-core
private void checkRelocking(ThreadContext context) {
if (lock.isHeldByCurrentThread()) {
throw context.runtime.newThreadError("Mutex relocking by same thread");
}
}
代码示例来源:origin: org.jruby/jruby-complete
@Deprecated
public IRubyObject execRecursive(RecursiveFunction func, IRubyObject obj) {
if (!inRecursiveListOperation.get()) {
throw runtime.newThreadError("BUG: execRecursive called outside recursiveListOperation");
}
return execRecursiveInternal(func, obj, null, false);
}
代码示例来源:origin: org.jruby/jruby-core
private IRubyObject peekTake() {
try {
return lastValue = out.take();
} catch (InterruptedException ie) {
throw runtime.newThreadError("interrupted during iteration");
}
}
代码示例来源:origin: org.jruby/jruby-complete
private IRubyObject take() {
try {
if (lastValue != null) {
return lastValue;
}
return out.take();
} catch (InterruptedException ie) {
throw runtime.newThreadError("interrupted during iteration");
} finally {
lastValue = null;
}
}
代码示例来源:origin: org.jruby/jruby-complete
private IRubyObject peekTake() {
try {
return lastValue = out.take();
} catch (InterruptedException ie) {
throw runtime.newThreadError("interrupted during iteration");
}
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
private IRubyObject peekTake() {
try {
return lastValue = out.take();
} catch (InterruptedException ie) {
throw runtime.newThreadError("interrupted during iteration");
}
}
代码示例来源:origin: org.jruby/jruby-complete
@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");
}
boolean hasQueued = lock.hasQueuedThreads();
context.getThread().unlock(lock);
return hasQueued ? context.nil : this;
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
@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;
}
代码示例来源:origin: org.jruby/jruby-complete
protected RaiseException createInterruptedError(ThreadContext context, String methodName) {
return context.runtime.newThreadError("interrupted in " + getMetaClass().getName() + "#" + methodName);
}
}
代码示例来源:origin: org.jruby/jruby-core
@JRubyMethod
public synchronized RubyThread wakeup() {
if(!threadImpl.isAlive() && status.get() == Status.DEAD) {
throw getRuntime().newThreadError("killed thread");
}
status.set(Status.RUN);
interrupt();
return this;
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
@JRubyMethod(rest = true, visibility = PRIVATE)
public IRubyObject initialize(ThreadContext context, IRubyObject[] args, Block block) {
Ruby runtime = getRuntime();
if (!block.isGiven()) throw runtime.newThreadError("must be called with a block");
if (threadImpl != null) throw runtime.newThreadError("already initialized thread");
RubyRunnable runnable = new RubyRunnable(this, args, block);
return startWith(runnable);
}
代码示例来源:origin: org.jruby/jruby-complete
public void push(ThreadContext context, final IRubyObject[] args) {
checkShutdown();
try {
context.getThread().executeTask(context, args, putTask);
} catch (InterruptedException ie) {
throw context.runtime.newThreadError("interrupted in FiberQueue.push");
}
}
代码示例来源:origin: org.jruby/jruby-core
public void push(ThreadContext context, final IRubyObject[] args) {
checkShutdown();
try {
context.getThread().executeTask(context, args, putTask);
} catch (InterruptedException ie) {
throw context.runtime.newThreadError("interrupted in FiberQueue.push");
}
}
内容来源于网络,如有侵权,请联系作者删除!