Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-25 18:40:05 +01:00
Actually implement ChunkHolder/ChunkSet pools (#1840)
Dieser Commit ist enthalten in:
Ursprung
800988aae7
Commit
8094b68967
@ -67,7 +67,13 @@ public class ChunkHolder<T extends Future<T>> implements IQueueChunk<T> {
|
|||||||
@Override
|
@Override
|
||||||
public synchronized void recycle() {
|
public synchronized void recycle() {
|
||||||
delegate = NULL;
|
delegate = NULL;
|
||||||
chunkSet = null;
|
if (chunkSet != null) {
|
||||||
|
chunkSet.recycle();
|
||||||
|
chunkSet = null;
|
||||||
|
}
|
||||||
|
chunkExisting = null;
|
||||||
|
extent = null;
|
||||||
|
POOL.offer(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized IBlockDelegate getDelegate() {
|
public synchronized IBlockDelegate getDelegate() {
|
||||||
@ -1039,7 +1045,9 @@ public class ChunkHolder<T extends Future<T>> implements IQueueChunk<T> {
|
|||||||
chunkSet.setBitMask(bitMask);
|
chunkSet.setBitMask(bitMask);
|
||||||
try {
|
try {
|
||||||
return this.call(chunkSet, () -> {
|
return this.call(chunkSet, () -> {
|
||||||
recycle();
|
this.delegate = NULL;
|
||||||
|
chunkSet.recycle();
|
||||||
|
chunkSet = null;
|
||||||
calledLock.unlock(stamp);
|
calledLock.unlock(stamp);
|
||||||
});
|
});
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren