java.lang.Thread.pushInterruptAction$()方法的使用及代码示例

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

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

Thread.pushInterruptAction$介绍

[英]Adds a runnable to be invoked upon interruption. If this thread has already been interrupted, the runnable will be invoked immediately. The action should be idempotent as it may be invoked multiple times for a single interruption.

Each call to this method must be matched with a corresponding call to #popInterruptAction$.
[中]添加可在中断时调用的runnable。如果这个线程已经被中断,runnable将被立即调用。动作应该是幂等的,因为它可以在一次中断中多次调用。
对该方法的每次调用必须与对#popInterruptAction$的相应调用相匹配。

代码示例

代码示例来源:origin: robovm/robovm

/**
 * Indicates the beginning of a code section that includes an I/O operation
 * that is potentially blocking. After this operation, the application
 * should invoke the corresponding {@code end(boolean)} method.
 */
protected final void begin() {
  Thread.currentThread().pushInterruptAction$(wakeupRunnable);
}

代码示例来源:origin: robovm/robovm

/**
 * Indicates the beginning of a code section that includes an I/O operation
 * that is potentially blocking. After this operation, the application
 * should invoke the corresponding {@code end(boolean)} method.
 */
protected final void begin() {
  Thread.currentThread().pushInterruptAction$(interruptAndCloseRunnable);
}

代码示例来源:origin: MobiVM/robovm

/**
 * Indicates the beginning of a code section that includes an I/O operation
 * that is potentially blocking. After this operation, the application
 * should invoke the corresponding {@code end(boolean)} method.
 */
protected final void begin() {
  Thread.currentThread().pushInterruptAction$(wakeupRunnable);
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Indicates the beginning of a code section that includes an I/O operation
 * that is potentially blocking. After this operation, the application
 * should invoke the corresponding {@code end(boolean)} method.
 */
protected final void begin() {
  Thread.currentThread().pushInterruptAction$(interruptAndCloseRunnable);
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Indicates the beginning of a code section that includes an I/O operation
 * that is potentially blocking. After this operation, the application
 * should invoke the corresponding {@code end(boolean)} method.
 */
protected final void begin() {
  Thread.currentThread().pushInterruptAction$(interruptAndCloseRunnable);
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Indicates the beginning of a code section that includes an I/O operation
 * that is potentially blocking. After this operation, the application
 * should invoke the corresponding {@code end(boolean)} method.
 */
protected final void begin() {
  Thread.currentThread().pushInterruptAction$(wakeupRunnable);
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Indicates the beginning of a code section that includes an I/O operation
 * that is potentially blocking. After this operation, the application
 * should invoke the corresponding {@code end(boolean)} method.
 */
protected final void begin() {
  Thread.currentThread().pushInterruptAction$(interruptAndCloseRunnable);
}

代码示例来源:origin: ibinti/bugvm

/**
 * Indicates the beginning of a code section that includes an I/O operation
 * that is potentially blocking. After this operation, the application
 * should invoke the corresponding {@code end(boolean)} method.
 */
protected final void begin() {
  Thread.currentThread().pushInterruptAction$(interruptAndCloseRunnable);
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Indicates the beginning of a code section that includes an I/O operation
 * that is potentially blocking. After this operation, the application
 * should invoke the corresponding {@code end(boolean)} method.
 */
protected final void begin() {
  Thread.currentThread().pushInterruptAction$(wakeupRunnable);
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Indicates the beginning of a code section that includes an I/O operation
 * that is potentially blocking. After this operation, the application
 * should invoke the corresponding {@code end(boolean)} method.
 */
protected final void begin() {
  Thread.currentThread().pushInterruptAction$(wakeupRunnable);
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Indicates the beginning of a code section that includes an I/O operation
 * that is potentially blocking. After this operation, the application
 * should invoke the corresponding {@code end(boolean)} method.
 */
protected final void begin() {
  Thread.currentThread().pushInterruptAction$(interruptAndCloseRunnable);
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Indicates the beginning of a code section that includes an I/O operation
 * that is potentially blocking. After this operation, the application
 * should invoke the corresponding {@code end(boolean)} method.
 */
protected final void begin() {
  Thread.currentThread().pushInterruptAction$(wakeupRunnable);
}

代码示例来源:origin: ibinti/bugvm

/**
 * Indicates the beginning of a code section that includes an I/O operation
 * that is potentially blocking. After this operation, the application
 * should invoke the corresponding {@code end(boolean)} method.
 */
protected final void begin() {
  Thread.currentThread().pushInterruptAction$(wakeupRunnable);
}

代码示例来源:origin: MobiVM/robovm

/**
 * Indicates the beginning of a code section that includes an I/O operation
 * that is potentially blocking. After this operation, the application
 * should invoke the corresponding {@code end(boolean)} method.
 */
protected final void begin() {
  Thread.currentThread().pushInterruptAction$(interruptAndCloseRunnable);
}

相关文章