java.util.concurrent.FutureTask.removeWaiter()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(177)

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

FutureTask.removeWaiter介绍

[英]Tries to unlink a timed-out or interrupted wait node to avoid accumulating garbage. Internal nodes are simply unspliced without CAS since it is harmless if they are traversed anyway by releasers. To avoid effects of unsplicing from already removed nodes, the list is retraversed in case of an apparent race. This is slow when there are a lot of nodes, but we don't expect lists to be long enough to outweigh higher-overhead schemes.
[中]尝试取消链接超时或中断的等待节点,以避免累积垃圾。内部节点在没有CA的情况下是简单的无许可的,因为如果释放器无论如何都遍历它们,这是无害的。为了避免已经删除的节点的未显示的影响,在出现明显的竞争时,将重新遍历列表。当有很多节点时,这是很慢的,但我们不希望列表足够长,超过更高的开销方案。

代码示例

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

for (;;) {
  if (Thread.interrupted()) {
    removeWaiter(q);
    throw new InterruptedException();
    nanos = deadline - System.nanoTime();
    if (nanos <= 0L) {
      removeWaiter(q);
      return state;

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

for (;;) {
  if (Thread.interrupted()) {
    removeWaiter(q);
    throw new InterruptedException();
    nanos = deadline - System.nanoTime();
    if (nanos <= 0L) {
      removeWaiter(q);
      return state;

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

for (;;) {
  if (Thread.interrupted()) {
    removeWaiter(q);
    throw new InterruptedException();
    nanos = deadline - System.nanoTime();
    if (nanos <= 0L) {
      removeWaiter(q);
      return state;

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

for (;;) {
  if (Thread.interrupted()) {
    removeWaiter(q);
    throw new InterruptedException();
    nanos = deadline - System.nanoTime();
    if (nanos <= 0L) {
      removeWaiter(q);
      return state;

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

for (;;) {
  if (Thread.interrupted()) {
    removeWaiter(q);
    throw new InterruptedException();
    nanos = deadline - System.nanoTime();
    if (nanos <= 0L) {
      removeWaiter(q);
      return state;

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

for (;;) {
  if (Thread.interrupted()) {
    removeWaiter(q);
    throw new InterruptedException();
    nanos = deadline - System.nanoTime();
    if (nanos <= 0L) {
      removeWaiter(q);
      return state;

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

for (;;) {
  if (Thread.interrupted()) {
    removeWaiter(q);
    throw new InterruptedException();
    nanos = deadline - System.nanoTime();
    if (nanos <= 0L) {
      removeWaiter(q);
      return state;

相关文章