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

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

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

ConcurrentSkipListMap.clearIndexToFirst介绍

[英]Clears out index nodes associated with deleted first entry.
[中]清除与已删除的第一个条目关联的索引节点。

代码示例

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

/**
 * Removes first entry; returns its snapshot.
 * @return null if empty, else snapshot of first entry
 */
Map.Entry<K,V> doRemoveFirstEntry() {
  for (;;) {
    Node<K,V> b = head.node;
    Node<K,V> n = b.next;
    if (n == null)
      return null;
    Node<K,V> f = n.next;
    if (n != b.next)
      continue;
    Object v = n.value;
    if (v == null) {
      n.helpDelete(b, f);
      continue;
    }
    if (!n.casValue(v, null))
      continue;
    if (!n.appendMarker(f) || !b.casNext(n, f))
      findFirst(); // retry
    clearIndexToFirst();
    return new AbstractMap.SimpleImmutableEntry<K,V>(n.key, (V)v);
  }
}

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

/**
 * Removes first entry; returns its snapshot.
 * @return null if empty, else snapshot of first entry
 */
Map.Entry<K,V> doRemoveFirstEntry() {
  for (;;) {
    Node<K,V> b = head.node;
    Node<K,V> n = b.next;
    if (n == null)
      return null;
    Node<K,V> f = n.next;
    if (n != b.next)
      continue;
    Object v = n.value;
    if (v == null) {
      n.helpDelete(b, f);
      continue;
    }
    if (!n.casValue(v, null))
      continue;
    if (!n.appendMarker(f) || !b.casNext(n, f))
      findFirst(); // retry
    clearIndexToFirst();
    return new AbstractMap.SimpleImmutableEntry<K,V>(n.key, (V)v);
  }
}

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

/**
 * Removes first entry; returns its snapshot.
 * @return null if empty, else snapshot of first entry
 */
Map.Entry<K,V> doRemoveFirstEntry() {
  for (;;) {
    Node<K,V> b = head.node;
    Node<K,V> n = b.next;
    if (n == null)
      return null;
    Node<K,V> f = n.next;
    if (n != b.next)
      continue;
    Object v = n.value;
    if (v == null) {
      n.helpDelete(b, f);
      continue;
    }
    if (!n.casValue(v, null))
      continue;
    if (!n.appendMarker(f) || !b.casNext(n, f))
      findFirst(); // retry
    clearIndexToFirst();
    return new AbstractMap.SimpleImmutableEntry<K,V>(n.key, (V)v);
  }
}

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

/**
 * Removes first entry; returns its snapshot.
 * @return null if empty, else snapshot of first entry
 */
Map.Entry<K,V> doRemoveFirstEntry() {
  for (;;) {
    Node<K,V> b = head.node;
    Node<K,V> n = b.next;
    if (n == null)
      return null;
    Node<K,V> f = n.next;
    if (n != b.next)
      continue;
    Object v = n.value;
    if (v == null) {
      n.helpDelete(b, f);
      continue;
    }
    if (!n.casValue(v, null))
      continue;
    if (!n.appendMarker(f) || !b.casNext(n, f))
      findFirst(); // retry
    clearIndexToFirst();
    return new AbstractMap.SimpleImmutableEntry<K,V>(n.key, (V)v);
  }
}

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

/**
 * Removes first entry; returns its snapshot.
 * @return null if empty, else snapshot of first entry
 */
Map.Entry<K,V> doRemoveFirstEntry() {
  for (;;) {
    Node<K,V> b = head.node;
    Node<K,V> n = b.next;
    if (n == null)
      return null;
    Node<K,V> f = n.next;
    if (n != b.next)
      continue;
    Object v = n.value;
    if (v == null) {
      n.helpDelete(b, f);
      continue;
    }
    if (!n.casValue(v, null))
      continue;
    if (!n.appendMarker(f) || !b.casNext(n, f))
      findFirst(); // retry
    clearIndexToFirst();
    return new AbstractMap.SimpleImmutableEntry<K,V>(n.key, (V)v);
  }
}

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

/**
 * Removes first entry; returns its snapshot.
 * @return null if empty, else snapshot of first entry
 */
Map.Entry<K,V> doRemoveFirstEntry() {
  for (;;) {
    Node<K,V> b = head.node;
    Node<K,V> n = b.next;
    if (n == null)
      return null;
    Node<K,V> f = n.next;
    if (n != b.next)
      continue;
    Object v = n.value;
    if (v == null) {
      n.helpDelete(b, f);
      continue;
    }
    if (!n.casValue(v, null))
      continue;
    if (!n.appendMarker(f) || !b.casNext(n, f))
      findFirst(); // retry
    clearIndexToFirst();
    return new AbstractMap.SimpleImmutableEntry<K,V>(n.key, (V)v);
  }
}

代码示例来源:origin: org.codehaus.jsr166-mirror/jsr166

/**
 * Removes first entry; returns its snapshot.
 * @return null if empty, else snapshot of first entry
 */
Map.Entry<K,V> doRemoveFirstEntry() {
  for (;;) {
    Node<K,V> b = head.node;
    Node<K,V> n = b.next;
    if (n == null)
      return null;
    Node<K,V> f = n.next;
    if (n != b.next)
      continue;
    Object v = n.value;
    if (v == null) {
      n.helpDelete(b, f);
      continue;
    }
    if (!n.casValue(v, null))
      continue;
    if (!n.appendMarker(f) || !b.casNext(n, f))
      findFirst(); // retry
    clearIndexToFirst();
    return new AbstractMap.SimpleImmutableEntry<K,V>(n.key, (V)v);
  }
}

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

/**
 * Removes first entry; returns its snapshot.
 * @return null if empty, else snapshot of first entry
 */
Map.Entry<K,V> doRemoveFirstEntry() {
  for (;;) {
    Node<K,V> b = head.node;
    Node<K,V> n = b.next;
    if (n == null)
      return null;
    Node<K,V> f = n.next;
    if (n != b.next)
      continue;
    Object v = n.value;
    if (v == null) {
      n.helpDelete(b, f);
      continue;
    }
    if (!n.casValue(v, null))
      continue;
    if (!n.appendMarker(f) || !b.casNext(n, f))
      findFirst(); // retry
    clearIndexToFirst();
    return new AbstractMap.SimpleImmutableEntry<K,V>(n.key, (V)v);
  }
}

代码示例来源:origin: jtulach/bck2brwsr

/**
 * Removes first entry; returns its snapshot.
 * @return null if empty, else snapshot of first entry
 */
Map.Entry<K,V> doRemoveFirstEntry() {
  for (;;) {
    Node<K,V> b = head.node;
    Node<K,V> n = b.next;
    if (n == null)
      return null;
    Node<K,V> f = n.next;
    if (n != b.next)
      continue;
    Object v = n.value;
    if (v == null) {
      n.helpDelete(b, f);
      continue;
    }
    if (!n.casValue(v, null))
      continue;
    if (!n.appendMarker(f) || !b.casNext(n, f))
      findFirst(); // retry
    clearIndexToFirst();
    return new AbstractMap.SimpleImmutableEntry<K,V>(n.key, (V)v);
  }
}

代码示例来源:origin: org.apidesign.bck2brwsr/emul

/**
 * Removes first entry; returns its snapshot.
 * @return null if empty, else snapshot of first entry
 */
Map.Entry<K,V> doRemoveFirstEntry() {
  for (;;) {
    Node<K,V> b = head.node;
    Node<K,V> n = b.next;
    if (n == null)
      return null;
    Node<K,V> f = n.next;
    if (n != b.next)
      continue;
    Object v = n.value;
    if (v == null) {
      n.helpDelete(b, f);
      continue;
    }
    if (!n.casValue(v, null))
      continue;
    if (!n.appendMarker(f) || !b.casNext(n, f))
      findFirst(); // retry
    clearIndexToFirst();
    return new AbstractMap.SimpleImmutableEntry<K,V>(n.key, (V)v);
  }
}

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

/**
 * Removes first entry; returns its snapshot.
 * @return null if empty, else snapshot of first entry
 */
Map.Entry<K,V> doRemoveFirstEntry() {
  for (;;) {
    Node<K,V> b = head.node;
    Node<K,V> n = b.next;
    if (n == null)
      return null;
    Node<K,V> f = n.next;
    if (n != b.next)
      continue;
    Object v = n.value;
    if (v == null) {
      n.helpDelete(b, f);
      continue;
    }
    if (!n.casValue(v, null))
      continue;
    if (!n.appendMarker(f) || !b.casNext(n, f))
      findFirst(); // retry
    clearIndexToFirst();
    return new AbstractMap.SimpleImmutableEntry<K,V>(n.key, (V)v);
  }
}

相关文章

微信公众号

最新文章

更多

ConcurrentSkipListMap类方法