Skip to content

Commit

Permalink
chore: make state field volatile in AsyncResultSetImpl
Browse files Browse the repository at this point in the history
Mark the `state` field in `AsyncResultSetImpl` volatile, as it is
inspected by different threads.
  • Loading branch information
olavloite committed Dec 13, 2024
1 parent 8547735 commit ad86391
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ private enum State {
* Listeners that will be called when the {@link AsyncResultSetImpl} has finished fetching all
* rows and any underlying transaction or session can be closed.
*/
private Collection<Runnable> listeners = new LinkedList<>();
private final Collection<Runnable> listeners = new LinkedList<>();

private State state = State.INITIALIZED;
private volatile State state = State.INITIALIZED;

/** This variable indicates that produce rows thread is initiated */
private volatile boolean produceRowsInitiated;
Expand Down

0 comments on commit ad86391

Please sign in to comment.