Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ public BufferAllocator getParentAllocator() {

@Override
public Collection<BufferAllocator> getChildAllocators() {
return new HashSet<>(childAllocators.keySet());
synchronized (childAllocators) {
return new HashSet<>(childAllocators.keySet());
}
}

private static String createErrorMsg(final BufferAllocator allocator, final int rounded, final int requested) {
Expand Down Expand Up @@ -449,8 +451,10 @@ public synchronized void close() {
} else {
if (!childAllocators.isEmpty()) {
outstandingChildAllocators.append("Outstanding child allocators : \n");
for (final BaseAllocator childAllocator : childAllocators.keySet()) {
outstandingChildAllocators.append(String.format(" %s", childAllocator.toString()));
synchronized (childAllocators) {
for (final BaseAllocator childAllocator : childAllocators.keySet()) {
outstandingChildAllocators.append(String.format(" %s", childAllocator.toString()));
}
}
}
}
Expand Down