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

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

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

Ruby.newConcurrencyError介绍

暂无

代码示例

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

private static RuntimeException concurrentModification(Ruby runtime, Exception cause) {
  RuntimeException ex = runtime.newConcurrencyError("Detected invalid array contents due to unsynchronized modifications with concurrent users");
  // NOTE: probably not useful to be on except for debugging :
  // if ( cause != null ) ex.initCause(cause);
  return ex;
}

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

private static RuntimeException concurrentModification(Ruby runtime, Exception cause) {
  RuntimeException ex = runtime.newConcurrencyError("Detected invalid array contents due to unsynchronized modifications with concurrent users");
  // NOTE: probably not useful to be on except for debugging :
  // if ( cause != null ) ex.initCause(cause);
  return ex;
}

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

private static void concurrentModification(Ruby runtime) {
  throw runtime.newConcurrencyError("Detected invalid array contents due to unsynchronized modifications with concurrent users");
}

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

private static void concurrentModification(Ruby runtime) {
  throw runtime.newConcurrencyError("Detected invalid array contents due to unsynchronized modifications with concurrent users");
}

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

private final RaiseException concurrentModification() {
  return getRuntime().newConcurrencyError(
      "Detected invalid hash contents due to unsynchronized modifications with concurrent users");
}

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

private final RaiseException concurrentModification() {
  return getRuntime().newConcurrencyError(
      "Detected invalid hash contents due to unsynchronized modifications with concurrent users");
}

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

private final RaiseException concurrentModification() {
  return getRuntime().newConcurrencyError(
      "Detected invalid hash contents due to unsynchronized modifications with concurrent users");
}

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

private final RaiseException concurrentModification() {
  return getRuntime().newConcurrencyError(
      "Detected invalid hash contents due to unsynchronized modifications with concurrent users");
}

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

public static int writeInternal(ThreadContext context, OpenFile fptr, ChannelFD fd, byte[] bufBytes, int buf, int count) {
  InternalWriteStruct iis = new InternalWriteStruct(fptr, fd, bufBytes, buf, count);
  try {
    return context.getThread().executeTask(context, iis, writeTask);
  } catch (InterruptedException ie) {
    throw context.runtime.newConcurrencyError("IO operation interrupted");
  }
}

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

public static int writeInternal(ThreadContext context, OpenFile fptr, ChannelFD fd, byte[] bufBytes, int buf, int count) {
  InternalWriteStruct iis = new InternalWriteStruct(fptr, fd, bufBytes, buf, count);
  try {
    return context.getThread().executeTask(context, iis, writeTask);
  } catch (InterruptedException ie) {
    throw context.runtime.newConcurrencyError("IO operation interrupted");
  }
}

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

((SelectableChannel) readIOs[i].getChannel()).configureBlocking(readBlocking[i]);
} catch (IllegalBlockingModeException ibme) {
  throw runtime.newConcurrencyError("can not set IO blocking after select; concurrent select detected?");
  ((SelectableChannel) writeIOs[i].getChannel()).configureBlocking(writeBlocking[i]);
} catch (IllegalBlockingModeException ibme) {
  throw runtime.newConcurrencyError("can not set IO blocking after select; concurrent select detected?");

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

((SelectableChannel) readIOs[i].getChannel()).configureBlocking(readBlocking[i]);
} catch (IllegalBlockingModeException ibme) {
  throw runtime.newConcurrencyError("can not set IO blocking after select; concurrent select detected?");
  ((SelectableChannel) writeIOs[i].getChannel()).configureBlocking(writeBlocking[i]);
} catch (IllegalBlockingModeException ibme) {
  throw runtime.newConcurrencyError("can not set IO blocking after select; concurrent select detected?");

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

((SelectableChannel) readIOs[i].getChannel()).configureBlocking(readBlocking[i]);
} catch (IllegalBlockingModeException ibme) {
  throw runtime.newConcurrencyError("can not set IO blocking after select; concurrent select detected?");
  ((SelectableChannel) writeIOs[i].getChannel()).configureBlocking(writeBlocking[i]);
} catch (IllegalBlockingModeException ibme) {
  throw runtime.newConcurrencyError("can not set IO blocking after select; concurrent select detected?");

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

((SelectableChannel) readIOs[i].getChannel()).configureBlocking(readBlocking[i]);
} catch (IllegalBlockingModeException ibme) {
  throw runtime.newConcurrencyError("can not set IO blocking after select; concurrent select detected?");
  ((SelectableChannel) writeIOs[i].getChannel()).configureBlocking(writeBlocking[i]);
} catch (IllegalBlockingModeException ibme) {
  throw runtime.newConcurrencyError("can not set IO blocking after select; concurrent select detected?");

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

@JRubyMethod
public IRubyObject lock(ThreadContext context) {
  try {
    context.getThread().enterSleep();
    try {
      checkRelocking(context);
      context.getThread().lockInterruptibly(lock);
    } catch (InterruptedException ex) {
      context.pollThreadEvents();
      throw context.runtime.newConcurrencyError("interrupted waiting for mutex: " + ex.getMessage());
    }
  } finally {
    context.getThread().exitSleep();
  }
  return this;
}

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

@JRubyMethod
public IRubyObject lock(ThreadContext context) {
  try {
    context.getThread().enterSleep();
    try {
      checkRelocking(context);
      context.getThread().lockInterruptibly(lock);
    } catch (InterruptedException ex) {
      context.pollThreadEvents();
      throw context.runtime.newConcurrencyError("interrupted waiting for mutex: " + ex.getMessage());
    }
  } finally {
    context.getThread().exitSleep();
  }
  return this;
}

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

throw runtime.newConcurrencyError("thread interrupted");
    success = context.getThread().wait_timeout(this, timeout);
  } catch (InterruptedException ie) {
    throw runtime.newConcurrencyError(ie.getLocalizedMessage());
  } finally {

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

throw runtime.newConcurrencyError("thread interrupted");
    success = context.getThread().wait_timeout(this, timeout);
  } catch (InterruptedException ie) {
    throw runtime.newConcurrencyError(ie.getLocalizedMessage());
  } finally {

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

public static int readInternal(ThreadContext context, OpenFile fptr, ChannelFD fd, byte[] bufBytes, int buf, int count) {
  InternalReadStruct iis = new InternalReadStruct(fptr, fd, bufBytes, buf, count);
  // if we can do selection and this is not a non-blocking call, do selection
  /*
    NOTE CON: We only do this selection because on the JDK, blocking calls to NIO channels can't be
    interrupted, and we need to be able to interrupt blocking reads. In MRI, this logic is always just a
    simple read(2) because EINTR does not damage the descriptor.
    Doing selects here on ENXIO native channels caused FIFOs to block for read all the time, even when no
    writers are connected. This may or may not be correct behavior for selects against FIFOs, but in any
    case since MRI does not do a select here at all I believe correct logic is to skip the select when
    working with any native descriptor.
   */
  fptr.unlock();
  try {
    if (fd.chSelect != null
        && fd.chNative == null // MRI does not select for rb_read_internal on native descriptors
        && !iis.fptr.nonblock) {
      context.getThread().select(fd.chSelect, fptr, SelectionKey.OP_READ);
    }
  } finally {
    fptr.lock();
  }
  try {
    return context.getThread().executeTask(context, iis, readTask);
  } catch (InterruptedException ie) {
    throw context.runtime.newConcurrencyError("IO operation interrupted");
  }
}

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

public static int readInternal(ThreadContext context, OpenFile fptr, ChannelFD fd, byte[] bufBytes, int buf, int count) {
  InternalReadStruct iis = new InternalReadStruct(fptr, fd, bufBytes, buf, count);
  // if we can do selection and this is not a non-blocking call, do selection
  /*
    NOTE CON: We only do this selection because on the JDK, blocking calls to NIO channels can't be
    interrupted, and we need to be able to interrupt blocking reads. In MRI, this logic is always just a
    simple read(2) because EINTR does not damage the descriptor.
    Doing selects here on ENXIO native channels caused FIFOs to block for read all the time, even when no
    writers are connected. This may or may not be correct behavior for selects against FIFOs, but in any
    case since MRI does not do a select here at all I believe correct logic is to skip the select when
    working with any native descriptor.
   */
  fptr.unlock();
  try {
    if (fd.chSelect != null
        && fd.chNative == null // MRI does not select for rb_read_internal on native descriptors
        && !iis.fptr.nonblock) {
      context.getThread().select(fd.chSelect, fptr, SelectionKey.OP_READ);
    }
  } finally {
    fptr.lock();
  }
  try {
    return context.getThread().executeTask(context, iis, readTask);
  } catch (InterruptedException ie) {
    throw context.runtime.newConcurrencyError("IO operation interrupted");
  }
}

相关文章

Ruby类方法