本文整理了Java中java.util.concurrent.ConcurrentSkipListMap.clearIndexToFirst()
方法的一些代码示例,展示了ConcurrentSkipListMap.clearIndexToFirst()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ConcurrentSkipListMap.clearIndexToFirst()
方法的具体详情如下:
包路径:java.util.concurrent.ConcurrentSkipListMap
类名称: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);
}
}
内容来源于网络,如有侵权,请联系作者删除!