Skip to content

Commit

Permalink
Merge pull request #77 from eighthave/volatile
Browse files Browse the repository at this point in the history
use "volatile" for key variables that are accessed across threads
  • Loading branch information
n8fr8 authored Apr 24, 2022
2 parents 31422fb + dc2e19e commit 95eca2a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ private static File getAppTorServiceDataDir(Context context) {
private long torConfiguration = -1;
private int torControlFd = -1;

private TorControlConnection torControlConnection;
private volatile TorControlConnection torControlConnection;

/**
* This lock must be acquired before calling createTorConfiguration() and
Expand Down Expand Up @@ -310,7 +310,7 @@ public void onEvent(int event, @Nullable String name) {
}
};

private CountDownLatch controlPortThreadStarted;
private volatile CountDownLatch controlPortThreadStarted;

private int getPortFromGetInfo(String key) {
final String value = getInfo(key);
Expand Down

0 comments on commit 95eca2a

Please sign in to comment.