Skip to content

Commit

Permalink
Bug 582814 Remove unneeded synchronized in IntIndexCollector::get
Browse files Browse the repository at this point in the history
Extra javadoc to note the concurrency semantics.

Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=582814
  • Loading branch information
jasonk000 committed Jan 17, 2024
1 parent 6d27b35 commit 4842f05
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down

0 comments on commit 4842f05

Please sign in to comment.