Skip to content

Commit eed539a

Browse files
committed
make the sodium singleton synchronized to protect against multi threaded access
1 parent ad69969 commit eed539a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/pusher/client/crypto/nacl/Sodium.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public abstract class Sodium {
77

88
private static LazySodiumJava lazySodium = null;
99

10-
public static LazySodiumJava getInstance() {
10+
public static synchronized LazySodiumJava getInstance() {
1111
if (lazySodium == null) {
1212
lazySodium = new LazySodiumJava(new SodiumJava());
1313
}

0 commit comments

Comments
 (0)