From c29e55c4406cf5b7c369b5267549bd967e383a05 Mon Sep 17 00:00:00 2001 From: ZhangYanWei Date: Wed, 26 Oct 2022 18:31:46 +0800 Subject: [PATCH] Bugfix: fix multi-threading issue * change ReLinkerInstance#loadedLibraries to CopyOnWriteArraySet --- .../main/java/com/getkeepsafe/relinker/ReLinkerInstance.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/relinker/src/main/java/com/getkeepsafe/relinker/ReLinkerInstance.java b/relinker/src/main/java/com/getkeepsafe/relinker/ReLinkerInstance.java index edddaa8..0678437 100755 --- a/relinker/src/main/java/com/getkeepsafe/relinker/ReLinkerInstance.java +++ b/relinker/src/main/java/com/getkeepsafe/relinker/ReLinkerInstance.java @@ -23,15 +23,15 @@ import java.io.File; import java.io.FilenameFilter; import java.io.IOException; -import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Set; +import java.util.concurrent.CopyOnWriteArraySet; public class ReLinkerInstance { private static final String LIB_DIR = "lib"; - protected final Set loadedLibraries = new HashSet(); + protected final Set loadedLibraries = new CopyOnWriteArraySet(); protected final ReLinker.LibraryLoader libraryLoader; protected final ReLinker.LibraryInstaller libraryInstaller;