org.jruby.Ruby.newThreadError()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(149)

本文整理了Java中org.jruby.Ruby.newThreadError方法的一些代码示例,展示了Ruby.newThreadError的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ruby.newThreadError方法的具体详情如下:
包路径:org.jruby.Ruby
类名称:Ruby
方法名:newThreadError

Ruby.newThreadError介绍

暂无

代码示例

代码示例来源:origin: org.jruby/jruby-complete

  1. private static void checkContext(ThreadContext firstContext, ThreadContext secondContext, String name) {
  2. if (firstContext != secondContext) {
  3. throw secondContext.runtime.newThreadError("Enumerable#" + name + " cannot be parallelized");
  4. }
  5. }

代码示例来源:origin: org.jruby/jruby-core

  1. private static void checkContext(ThreadContext firstContext, ThreadContext secondContext, String name) {
  2. if (firstContext != secondContext) {
  3. throw secondContext.runtime.newThreadError("Enumerable#" + name + " cannot be parallelized");
  4. }
  5. }

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

  1. private static void checkContext(ThreadContext firstContext, ThreadContext secondContext, String name) {
  2. if (firstContext != secondContext) {
  3. throw secondContext.runtime.newThreadError("Enumerable#" + name + " cannot be parallelized");
  4. }
  5. }

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

  1. private void threadCheck(ThreadContext yieldingContext) {
  2. if (originalContext != null && yieldingContext != originalContext) {
  3. throw yieldingContext.runtime.newThreadError("" + methodName + " cannot be parallelized");
  4. }
  5. }

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

  1. private static void checkContext(ThreadContext firstContext, ThreadContext secondContext, String name) {
  2. if (firstContext != secondContext) {
  3. throw secondContext.runtime.newThreadError("Enumerable#" + name + " cannot be parallelized");
  4. }
  5. }

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

  1. private void threadCheck(ThreadContext yieldingContext) {
  2. if (originalContext != null && yieldingContext != originalContext) {
  3. throw yieldingContext.runtime.newThreadError("" + methodName + " cannot be parallelized");
  4. }
  5. }

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

  1. private void checkRelocking(ThreadContext context) {
  2. if (lock.isHeldByCurrentThread()) {
  3. throw context.runtime.newThreadError("Mutex relocking by same thread");
  4. }
  5. }

代码示例来源:origin: org.jruby/jruby-core

  1. private void checkRelocking(ThreadContext context) {
  2. if (lock.isHeldByCurrentThread()) {
  3. throw context.runtime.newThreadError("Mutex relocking by same thread");
  4. }
  5. }

代码示例来源:origin: org.jruby/jruby-complete

  1. @Deprecated
  2. public IRubyObject execRecursive(RecursiveFunction func, IRubyObject obj) {
  3. if (!inRecursiveListOperation.get()) {
  4. throw runtime.newThreadError("BUG: execRecursive called outside recursiveListOperation");
  5. }
  6. return execRecursiveInternal(func, obj, null, false);
  7. }

代码示例来源:origin: org.jruby/jruby-core

  1. private IRubyObject peekTake() {
  2. try {
  3. return lastValue = out.take();
  4. } catch (InterruptedException ie) {
  5. throw runtime.newThreadError("interrupted during iteration");
  6. }
  7. }

代码示例来源:origin: org.jruby/jruby-complete

  1. private IRubyObject take() {
  2. try {
  3. if (lastValue != null) {
  4. return lastValue;
  5. }
  6. return out.take();
  7. } catch (InterruptedException ie) {
  8. throw runtime.newThreadError("interrupted during iteration");
  9. } finally {
  10. lastValue = null;
  11. }
  12. }

代码示例来源:origin: org.jruby/jruby-complete

  1. private IRubyObject peekTake() {
  2. try {
  3. return lastValue = out.take();
  4. } catch (InterruptedException ie) {
  5. throw runtime.newThreadError("interrupted during iteration");
  6. }
  7. }

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

  1. private IRubyObject peekTake() {
  2. try {
  3. return lastValue = out.take();
  4. } catch (InterruptedException ie) {
  5. throw runtime.newThreadError("interrupted during iteration");
  6. }
  7. }

代码示例来源:origin: org.jruby/jruby-complete

  1. @JRubyMethod
  2. public synchronized IRubyObject unlock(ThreadContext context) {
  3. Ruby runtime = context.runtime;
  4. if (!lock.isLocked()) {
  5. throw runtime.newThreadError("Mutex is not locked");
  6. }
  7. if (!lock.isHeldByCurrentThread()) {
  8. throw runtime.newThreadError("Mutex is not owned by calling thread");
  9. }
  10. boolean hasQueued = lock.hasQueuedThreads();
  11. context.getThread().unlock(lock);
  12. return hasQueued ? context.nil : this;
  13. }

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

  1. @JRubyMethod(name = "wakeup")
  2. public synchronized RubyThread wakeup() {
  3. if(!threadImpl.isAlive() && status.get() == Status.DEAD) {
  4. throw getRuntime().newThreadError("killed thread");
  5. }
  6. status.set(Status.RUN);
  7. notifyAll();
  8. return this;
  9. }

代码示例来源:origin: org.jruby/jruby-complete

  1. protected RaiseException createInterruptedError(ThreadContext context, String methodName) {
  2. return context.runtime.newThreadError("interrupted in " + getMetaClass().getName() + "#" + methodName);
  3. }
  4. }

代码示例来源:origin: org.jruby/jruby-core

  1. @JRubyMethod
  2. public synchronized RubyThread wakeup() {
  3. if(!threadImpl.isAlive() && status.get() == Status.DEAD) {
  4. throw getRuntime().newThreadError("killed thread");
  5. }
  6. status.set(Status.RUN);
  7. interrupt();
  8. return this;
  9. }

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

  1. @JRubyMethod(rest = true, visibility = PRIVATE)
  2. public IRubyObject initialize(ThreadContext context, IRubyObject[] args, Block block) {
  3. Ruby runtime = getRuntime();
  4. if (!block.isGiven()) throw runtime.newThreadError("must be called with a block");
  5. if (threadImpl != null) throw runtime.newThreadError("already initialized thread");
  6. RubyRunnable runnable = new RubyRunnable(this, args, block);
  7. return startWith(runnable);
  8. }

代码示例来源:origin: org.jruby/jruby-complete

  1. public void push(ThreadContext context, final IRubyObject[] args) {
  2. checkShutdown();
  3. try {
  4. context.getThread().executeTask(context, args, putTask);
  5. } catch (InterruptedException ie) {
  6. throw context.runtime.newThreadError("interrupted in FiberQueue.push");
  7. }
  8. }

代码示例来源:origin: org.jruby/jruby-core

  1. public void push(ThreadContext context, final IRubyObject[] args) {
  2. checkShutdown();
  3. try {
  4. context.getThread().executeTask(context, args, putTask);
  5. } catch (InterruptedException ie) {
  6. throw context.runtime.newThreadError("interrupted in FiberQueue.push");
  7. }
  8. }

相关文章

Ruby类方法