Clean queues
This commit is contained in:
parent
7a01b6a2a4
commit
f9b656986c
@ -244,6 +244,14 @@ public class LMDBArray<V> implements IArray<V>, Closeable {
|
|||||||
public void close() throws IOException {
|
public void close() throws IOException {
|
||||||
if (closed.compareAndSet(false, true)) {
|
if (closed.compareAndSet(false, true)) {
|
||||||
ensureThread();
|
ensureThread();
|
||||||
|
for (ByteBuf toWriteKey : toWriteKeys) {
|
||||||
|
toWriteKey.release();
|
||||||
|
}
|
||||||
|
for (ByteBuf toWriteValue : toWriteValues) {
|
||||||
|
toWriteValue.release();
|
||||||
|
}
|
||||||
|
toWriteKeys.clear();
|
||||||
|
toWriteValues.clear();
|
||||||
if (rwTxn != null) {
|
if (rwTxn != null) {
|
||||||
rwTxn.close();
|
rwTxn.close();
|
||||||
}
|
}
|
||||||
|
@ -498,6 +498,14 @@ public class LMDBPriorityQueue<T> implements PriorityQueue<T>, Reversable<Revers
|
|||||||
public void close() throws IOException {
|
public void close() throws IOException {
|
||||||
if (closed.compareAndSet(false, true)) {
|
if (closed.compareAndSet(false, true)) {
|
||||||
ensureThread();
|
ensureThread();
|
||||||
|
for (ByteBuf toWriteKey : toWriteKeys) {
|
||||||
|
toWriteKey.release();
|
||||||
|
}
|
||||||
|
for (ByteBuf toWriteValue : toWriteValues) {
|
||||||
|
toWriteValue.release();
|
||||||
|
}
|
||||||
|
toWriteKeys.clear();
|
||||||
|
toWriteValues.clear();
|
||||||
if (cur != null) {
|
if (cur != null) {
|
||||||
cur.close();
|
cur.close();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user