Skip to content

Commit

Permalink
Fix #4930: 2.3 IterationManager double checked lock idiom
Browse files Browse the repository at this point in the history
Signed-off-by: melloware <mellowaredev@gmail.com>
  • Loading branch information
melloware committed Nov 6, 2021
1 parent 8d73d7c commit 99b0dd3
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ static boolean isIterating(FaceletContext context){
private static Deque<Set<String>> _getStackOfTrackedIds(FaceletContext ctx) {
Deque<Set<String>> stack = (Deque<Set<String>>)ctx.getAttribute(_STACK_OF_TRACKED_IDS);
if (stack == null) {
stack = new LinkedList<>();
synchronized(IterationIdManager.class) {
if(stack == null) {
stack = new LinkedList<>();
}
}

ctx.setAttribute(_STACK_OF_TRACKED_IDS, stack);
}
return stack;
Expand Down

0 comments on commit 99b0dd3

Please sign in to comment.