From 4842f05f2afe384905d289cf1d724d2ed773c655 Mon Sep 17 00:00:00 2001 From: Jason Koch Date: Tue, 16 Jan 2024 17:20:22 -0800 Subject: [PATCH] Bug 582814 Remove unneeded synchronized in IntIndexCollector::get Extra javadoc to note the concurrency semantics. Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=582814 --- .../org/eclipse/mat/parser/index/IndexWriter.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugins/org.eclipse.mat.parser/src/org/eclipse/mat/parser/index/IndexWriter.java b/plugins/org.eclipse.mat.parser/src/org/eclipse/mat/parser/index/IndexWriter.java index 6aca6a050..728e98b15 100644 --- a/plugins/org.eclipse.mat.parser/src/org/eclipse/mat/parser/index/IndexWriter.java +++ b/plugins/org.eclipse.mat.parser/src/org/eclipse/mat/parser/index/IndexWriter.java @@ -702,6 +702,12 @@ public int next() }); } + /** + * Sets a value in the collector. + * + * Safe to be called concurrently from multiple threads. Not safe to mix + * concurrent get and set calls. + */ public void set(int index, int value) { ArrayIntCompressed array = getPage(index / pageSize); @@ -711,6 +717,12 @@ public void set(int index, int value) } } + /** + * Gets from the collected index. + * + * Safe to be called concurrently from multiple threads. Not safe to mix + * concurrent get and set calls. + */ public int get(int index) { // set() only happens during parsing stage, get later