forked from sofastack/sofa-boot
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
avoid concurrent problem in JvmFilterHolder
- Loading branch information
致节
committed
Apr 16, 2024
1 parent
cc9e6cf
commit 08463d3
Showing
1 changed file
with
2 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,17 +18,17 @@ | |
|
||
import org.springframework.core.Ordered; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Comparator; | ||
import java.util.List; | ||
import java.util.concurrent.CopyOnWriteArrayList; | ||
import java.util.concurrent.atomic.AtomicBoolean; | ||
|
||
/** | ||
* @author <a href="mailto:[email protected]">Alaneuler</a> | ||
* Created on 2020/8/18 | ||
*/ | ||
public class JvmFilterHolder { | ||
private static final List<JvmFilter> JVM_FILTERS = new ArrayList<>(); | ||
private static final List<JvmFilter> JVM_FILTERS = new CopyOnWriteArrayList<>(); | ||
private static final AtomicBoolean filtersSorted = new AtomicBoolean(false); | ||
|
||
private static final Comparator<Ordered> comparator = (f1, f2) -> { | ||
|